EnumHelper Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides methods for working with enumeration values and select lists.
public static class EnumHelper
type EnumHelper = class
Public Class EnumHelper
- Inheritance
-
EnumHelper
Methods
GetSelectList(ModelMetadata, Enum) |
Gets a list of SelectListItem objects corresponding to enum constants defined in the given metadata. Also ensures the value will round-trip even if it does not match a defined constant and sets the Selected property to true for one element in the returned list -- matching the value. |
GetSelectList(ModelMetadata) |
Gets a list of SelectListItem objects corresponding to enum constants defined in the given metadata. |
GetSelectList(Type, Enum) |
Gets a list of SelectListItem objects corresponding to enum constants defined in the given type. Also ensures the |
GetSelectList(Type) |
Gets a list of SelectListItem objects corresponding to enum constants defined in the given type. |
IsValidForEnumHelper(ModelMetadata) |
Gets a value indicating whether the given metadata or associated expression is suitable for use in GetSelectList(ModelMetadata) and EnumDropDownListFor<TModel,TEnum>(HtmlHelper<TModel>, Expression<Func<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(Type) and EnumDropDownListFor<TModel,TEnum>(HtmlHelper<TModel>, Expression<Func<TModel,TEnum>>) calls. |