Class EnumExtensions
Provides extension methods for mapping between enum types by name.
public static class EnumExtensions
- Inheritance
-
EnumExtensions
- Inherited Members
Methods
MapEnum<TTo, TFrom>(IEnumerable<TFrom>)
Maps a sequence of values from one enum type to another by matching enum member names.
public static IEnumerable<TTo> MapEnum<TTo, TFrom>(this IEnumerable<TFrom> from) where TTo : struct
Parameters
fromIEnumerable<TFrom>
Returns
- IEnumerable<TTo>
Type Parameters
TToTFrom
MapEnum<TTo, TFrom>(TFrom)
Maps a single value from one enum type to another by matching the enum member name.
public static TTo MapEnum<TTo, TFrom>(this TFrom from) where TTo : struct
Parameters
fromTFrom
Returns
- TTo
Type Parameters
TToTFrom