mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-27 07:57:33 +01:00
14 lines
362 B
C#
14 lines
362 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;
|
||
|
}
|
||
|
}
|