22 lines
527 B
C#
22 lines
527 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Shared
|
|
{
|
|
public static class ExMethod
|
|
{
|
|
public static string GetEnumDisplayName(this Enum enumType)
|
|
{
|
|
return enumType.GetType().GetMember(enumType.ToString())
|
|
.First()
|
|
.GetCustomAttribute<DisplayAttribute>()
|
|
.Name;
|
|
}
|
|
}
|
|
}
|