Hello all. I have read this post and I wanted to use ControllerExtensions.RedirectToAction method. But I have System.Security.VerificationException Which says: type argument '[MyController type]' violates the constraint of type parameter 'T'.
My controller is declared as follows:
public class ProductsSearchController : Controller
{
...
}
Help me, please. Also I tried to download the latest MvcContrib library from here. It didn't help me.
I noticed an interesting fact. I have this exception only when calling from unit tests. But there is no exception when using from web site. However it seems not working correctly. When I pass an object to the action in expression like this:
this.RedirectToAction(x => x.Index(filter))
it just call .ToString of this object! And I get url like this:
ProductsSearch?filter=WebShop.FinderModel.Filters.ProductsFilter
What is wrong?