EnumHelper.IsValidForEnumHelper Method
Gets a value indicating whether the given values are valid for enum helper.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | IsValidForEnumHelper(ModelMetadata) | Gets a value indicating whether the given metadata or associated expression is suitable for use in GetSelectList and EnumDropDownListFor<'TModel, 'TEnum> calls. |
![]() ![]() | IsValidForEnumHelper(Type) | Gets a value indicating whether the given type or an expression of this type is suitable for use in GetSelectList and EnumDropDownListFor<'TModel, 'TEnum> calls. |
EnumHelper.IsValidForEnumHelper Method (ModelMetadata)
Gets a value indicating whether the given metadata or associated expression is suitable for use in GetSelectList and EnumDropDownListFor<'TModel, 'TEnum> calls.
Parameters
- metadata
-
Type:
System.Web.Mvc.ModelMetadata
The metadata to check.
Return Value
Type: System.Booleantrue if GetSelectList will return not throw when passed given ModelMetadata and EnumDropDownListFor<'TModel, 'TEnum> will not throw when passed associated expression; otherwise, false.
Currently returns true if the metadata parameter is not null and IsValidForEnumHelper returns true for metadata.ModelType.
EnumHelper.IsValidForEnumHelper Method (Type)
Gets a value indicating whether the given type or an expression of this type is suitable for use in GetSelectList and EnumDropDownListFor<'TModel, 'TEnum> calls.
Parameters
- type
-
Type:
System.Type
The type to check.
Return Value
Type: System.Booleantrue if GetSelectList will not throw when passed the given type and EnumDropDownListFor<'TModel, 'TEnum> will not throw when passed an expression of this type; otherwise, false.
Currently returns true if the type parameter is not null, is an enum type, and does not have a FlagsAttribute attribute.

