Table of Contents

Class EnumExtensions

Namespace
Tharga.Toolkit
Assembly
Tharga.Toolkit.Standard.dll

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

from IEnumerable<TFrom>

Returns

IEnumerable<TTo>

Type Parameters

TTo
TFrom

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

from TFrom

Returns

TTo

Type Parameters

TTo
TFrom