EnumTypeModelBinder Class

Definition

IModelBinder implementation to bind models for types deriving from Enum.

public ref class EnumTypeModelBinder : Microsoft::AspNetCore::Mvc::ModelBinding::Binders::SimpleTypeModelBinder
public class EnumTypeModelBinder : Microsoft.AspNetCore.Mvc.ModelBinding.Binders.SimpleTypeModelBinder
type EnumTypeModelBinder = class
    inherit SimpleTypeModelBinder
Public Class EnumTypeModelBinder
Inherits SimpleTypeModelBinder
Inheritance
EnumTypeModelBinder

Constructors

EnumTypeModelBinder(Boolean, Type, ILoggerFactory)

Initializes a new instance of EnumTypeModelBinder.

Methods

BindModelAsync(ModelBindingContext)

Attempts to bind a model.

(Inherited from SimpleTypeModelBinder)
CheckModel(ModelBindingContext, ValueProviderResult, Object)

If the model is null, verifies that it is allowed to be null, otherwise notifies the ModelBindingContext.ModelState about the invalid valueProviderResult. Sets the P:ModelBindingContext.Result to the model if successful.

Applies to