MVC2, .NET4/C#4 optional parameters and Controller constructors
- by devlife
I am a big fan of optional parameters in C#4 but am having an issue with MVC when I use them in my controller constructors. For example, if I have a single constructor:
public TestController(sting a = "") { /* blah */ }
MVC has a fit saying that there are no parameterless constructors for TestController.
How can I get around this?