using System.ComponentModel;
public static void Main()
MatchType? matchType = MatchType.Auto;
Console.WriteLine(EnumHelper.GetDescription(matchType));
[Description("No Match")]
public static class EnumHelper
public static string GetDescription<T>(this T matchType)
var attribute = (DescriptionAttribute) matchType.GetType()
.GetField(matchType.ToString())
.GetCustomAttributes(false)
.Where(a => a is DescriptionAttribute)
return attribute != null ? attribute.Description : matchType.ToString();