I just follow the MVC 5 book and she creates a custom mediator for her shopping cart. What does he have in the book:
"public class CartModelBinder : IModelBinder {
private const string sessionKey = "Cart";
public object BindModel(ControllerContext controllerContext,
ModelBindingContext bindingContext) {"
Excerpt From: Adam Freeman. "Pro ASP.NET MVC 5." iBooks.
And when I started typing and created my class, it automatically created this:
public class CartModelBinder: IModelBinder
{
private const string sessionKey = "Cart";
public bool BindModel(ModelBindingExecutionContext modelBindingExecutionContext, ModelBindingContext bindingContext)
{
This returns objects and takes different parameters than the one IDE created for me. So what do we do now?
source
share