Class SimpleModelBinderProvider
- Namespace
- System.Web.Http.ModelBinding.Binders
- Assembly
- System.Web.Http.dll
Provides a simple model binder for this model binding class.
public sealed class SimpleModelBinderProvider : ModelBinderProvider
- Inheritance
-
SimpleModelBinderProvider
- Inherited Members
Constructors
SimpleModelBinderProvider(Type, Func<IModelBinder>)
Initializes a new instance of the SimpleModelBinderProvider class.
public SimpleModelBinderProvider(Type modelType, Func<IModelBinder> modelBinderFactory)
Parameters
modelTypeTypeThe model type.
modelBinderFactoryFunc<IModelBinder>The model binder factory.
SimpleModelBinderProvider(Type, IModelBinder)
Initializes a new instance of the SimpleModelBinderProvider class by using the specified model type and the model binder.
public SimpleModelBinderProvider(Type modelType, IModelBinder modelBinder)
Parameters
modelTypeTypeThe model type.
modelBinderIModelBinderThe model binder.
Properties
ModelType
Gets the type of the model.
public Type ModelType { get; }
Property Value
- Type
The type of the model.
SuppressPrefixCheck
Gets or sets a value that specifies whether the prefix check should be suppressed.
public bool SuppressPrefixCheck { get; set; }
Property Value
- bool
true if the prefix check should be suppressed; otherwise, false.
Methods
GetBinder(HttpConfiguration, Type)
Returns a model binder by using the specified execution context and binding context.
public override IModelBinder GetBinder(HttpConfiguration configuration, Type modelType)
Parameters
configurationHttpConfigurationThe configuration.
modelTypeTypeThe model type.
Returns
- IModelBinder
The model binder, or null if the attempt to get a model binder is unsuccessful.