Default parameter values in OpenRasta

So, MVC 2 is innovating by having default values on parameters. I think there’s a lot of value in doing that, and as such OpenRasta has always supported those. Here’s an example.

public object Search([Optional, DefaultParameterValue("*")]string searchString)
{
    return ...;
}

I’m glad the guys at Redmond saw the value in that. The do however use an attribute that wasn’t meant for optional parameter values. At least the way OpenRasta supports it, VB methods with optional parameters and default values work out of the box.

Ads

Comment