/// <summary> /// 返回枚举中的desciption /// </summary> /// <param name="value">枚举</param> /// <returns></returns> public static string GetDescription(this Enum value) { return value.GetType() .GetMember(value.ToString()) .FirstOrDefault()? .GetCustomAttribute<DescriptionAttribute>()? .Description; }