mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 10:46:33 +00:00
renmove ResourceEnum, use filename only
add ToHash for encryption Key
This commit is contained in:
@@ -26,15 +26,15 @@ public static class EnumExtensions
|
||||
}
|
||||
|
||||
/// <summary> Get attribute for enum's member, usually is used for getting Description attribute </summary>
|
||||
public static TAttrib GetEnumAttrib<T, TAttrib>(this T value) where T: Enum
|
||||
private static TAttrib GetEnumAttrib<T, TAttrib>(this T value) where T: Enum
|
||||
{
|
||||
var field = value.GetType().GetField(value.ToString());
|
||||
if (field == null)
|
||||
return default;
|
||||
return default!;
|
||||
|
||||
return field.GetCustomAttributes(typeof(TAttrib), false)
|
||||
.Cast<TAttrib>()
|
||||
.FirstOrDefault();
|
||||
.FirstOrDefault()!;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user