Class EnumListModelBinder<T>
Binds a list of enums in a model.
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<T>
Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ArrayModelBinder<T>
EnumListModelBinder<T>
Implements
Microsoft.AspNetCore.Mvc.ModelBinding.ICollectionModelBinder
Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder
Inherited Members
Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ArrayModelBinder<T>.CanCreateInstance(System.Type)
Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ArrayModelBinder<T>.ConvertToCollectionType(System.Type, System.Collections.Generic.IEnumerable<T>)
Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ArrayModelBinder<T>.CopyToModel(System.Object, System.Collections.Generic.IEnumerable<T>)
Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ArrayModelBinder<T>.CreateEmptyCollection(System.Type)
Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<T>.AddErrorIfBindingRequired(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext)
Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<T>.CreateInstance(System.Type)
Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<T>.ElementBinder
Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<T>.Logger
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ChameleonForms.ModelBinders
Assembly: ChameleonForms.dll
Syntax
public class EnumListModelBinder<T> : ArrayModelBinder<T>, ICollectionModelBinder, IModelBinder
Type Parameters
Name | Description |
---|---|
T |
Constructors
| Improve this Doc View SourceEnumListModelBinder(IModelBinder, ILoggerFactory, Boolean, MvcOptions)
Creates a new EnumListModelBinder<T>.
Declaration
public EnumListModelBinder(IModelBinder elementBinder, ILoggerFactory loggerFactory, bool allowValidatingTopLevelNodes, MvcOptions mvcOptions)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder | elementBinder | The Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder for binding |
Microsoft.Extensions.Logging.ILoggerFactory | loggerFactory | The Microsoft.Extensions.Logging.ILoggerFactory. |
System.Boolean | allowValidatingTopLevelNodes | Indication that validation of top-level models is enabled. If true and Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata.IsBindingRequired is true for a top-level model, the binder adds a Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary error when the model is not bound. |
Microsoft.AspNetCore.Mvc.MvcOptions | mvcOptions | The Microsoft.AspNetCore.Mvc.MvcOptions. |
Methods
| Improve this Doc View SourceBindModelAsync(ModelBindingContext)
Called when binding a model using this model binder.
Declaration
public override Task BindModelAsync(ModelBindingContext bindingContext)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext | bindingContext | The context within which binding occurs |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Overrides
Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<T>.BindModelAsync(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext)
Implements
Microsoft.AspNetCore.Mvc.ModelBinding.ICollectionModelBinder
Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder