C# Class MvcContrib.Binders.DerivedTypeModelBinder

This model binder extends the default model binder to detect alternate runtime types on a page and allow the binder adapt to derived types.
Inheritance: System.Web.Mvc.DefaultModelBinder, IPropertyNameProvider
Datei anzeigen Open project: atomicobject/mvccontrib Class Usage Examples

Public Methods

Method Description
CreatePropertyName ( string prefix, string propertyName ) : string
DerivedTypeModelBinder ( ) : System
DerivedTypeModelBinder ( ITypeStampOperator typeStampOperator ) : System

Protected Methods

Method Description
CreateModel ( System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ModelBindingContext bindingContext, Type modelType ) : object

An override of CreateModel that focuses on detecting alternate types at runtime

DetectInstantiationType ( System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ModelBindingContext bindingContext, Type typeToCreate ) : Type

Method Details

CreateModel() protected method

An override of CreateModel that focuses on detecting alternate types at runtime
protected CreateModel ( System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ModelBindingContext bindingContext, Type modelType ) : object
controllerContext System.Web.Mvc.ControllerContext the controller context
bindingContext System.Web.Mvc.ModelBindingContext the binding context
modelType System.Type the target type to be instantiated by this method and rehydrated by /// the default model binder
return object

CreatePropertyName() public method

public CreatePropertyName ( string prefix, string propertyName ) : string
prefix string
propertyName string
return string

DerivedTypeModelBinder() public method

public DerivedTypeModelBinder ( ) : System
return System

DerivedTypeModelBinder() public method

public DerivedTypeModelBinder ( ITypeStampOperator typeStampOperator ) : System
typeStampOperator ITypeStampOperator
return System

DetectInstantiationType() protected method

protected DetectInstantiationType ( System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ModelBindingContext bindingContext, Type typeToCreate ) : Type
controllerContext System.Web.Mvc.ControllerContext
bindingContext System.Web.Mvc.ModelBindingContext
typeToCreate System.Type
return System.Type