mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 01:43:50 +01:00
14 lines
361 B
C#
14 lines
361 B
C#
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
|
|
namespace BTCPayServer
|
|
{
|
|
public static class EnumExtensions
|
|
{
|
|
public static string DisplayName(this Type enumType, string input) =>
|
|
enumType.GetMember(input).First().GetCustomAttribute<DisplayAttribute>()?.Name ?? input;
|
|
}
|
|
}
|