StringExtensions.AsEnum Method

Namespace:
Weavy.Core.Helpers
Assembly:
Weavy.Core.dll

AsEnum(String)

Helper method for converting a string to an enum of type TEnum.

public static TEnum? AsEnum(this string input)
    where TEnum : struct

Parameters

input
System.String

Returns

System.Nullable{{TEnum}}

An object of type TEnum or null if the conversion fails.