/// <summary> /// Convert <see cref="object"/> to the given type enum. /// </summary> /// <param name="member"></param> /// <param name="enumType"></param> /// <param name="defaultVal"></param> /// <returns></returns> public static object ToEnum(object member, Type enumType, object defaultVal = default) { return(EnumConv.ObjToEnum(member, enumType, defaultVal)); }
/// <summary> /// Convert <see cref="object"/> to TEnum. /// </summary> /// <param name="member"></param> /// <param name="defaultVal"></param> /// <typeparam name="TEnum"></typeparam> /// <returns></returns> public static TEnum ToEnum <TEnum>(object member, TEnum defaultVal = default) where TEnum : struct, Enum { return(EnumConv.ObjToEnum(member, defaultVal)); }