In MVC 3, I created custom model bindings by creating a new class that implemented Systen.Web.Mvc.IModelBinderand then registering it internally Global.asax.csand internally Application_Start()usingModelBinders.Binders.Add(typeof(sometype), new MyModelBinder());
In MVC 4, I understand what you should use System.Web.Http.ModelBinding.IModelBinderto implement pattern bindings.
I have two questions:
Why should we use model binding from System.Web.Http.ModelBindingrather than from Systen.Web.Mvc? I don’t see it listed as obsolete, so what's the problem with the old one?
If I am selling my connecting device from System.Web.Http.ModelBinding.IModelBinder, how can I register it inside my application so that it is really used?
source
share