ModelBinderAttribute Class

An attribute that can specify a model name or type of Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder to use for binding.

Namespace
Microsoft.AspNetCore.Mvc
Assemblies
  • Microsoft.AspNetCore.Mvc.Core

Syntax

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
public class ModelBinderAttribute : Attribute, _Attribute, IModelNameProvider, IBinderTypeProviderMetadata, IBindingSourceMetadata
class Microsoft.AspNetCore.Mvc.ModelBinderAttribute

Properties

Microsoft.AspNetCore.Mvc.ModelBinderAttribute.BinderType
Return type:System.Type
public Type BinderType { get; set; }
Microsoft.AspNetCore.Mvc.ModelBinderAttribute.BindingSource
Return type:Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource
public virtual BindingSource BindingSource { get; protected set; }
Microsoft.AspNetCore.Mvc.ModelBinderAttribute.Name
Return type:System.String
public string Name { get; set; }