I tried to create my own connecting device in my ASP.NET MVC 4 project. But I am stuck with iterfaces from IModelBinder. There are three IModelBinder VS interfaces. In the following namespaces.
using System.Web.Http.ModelBinding; using System.Web.Mvc; using System.Web.ModelBinding; bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext) object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext); bool BindModel(ModelBindingExecutionContext modelBindingExecutionContext, ModelBindingContext bindingContext);
All related classes, such as ModelBindingContext , ModelMetadata strong> and others, are also duplicated. My friend and I cannot find out what the purpose of such a terrible code duplication is. Why didn't Microsoft developers extract common classes for co-assembly? As I understand it, one interface is used in MVC, one in Web Api, and what is the purpose of the third version? Are these interfaces independent or somehow interconnected with each other?
Mark lavrynenko
source share