比如,枚举如下:
[Serializable]
public enum PayType : int
{
/// <summary>
/// AAA
/// </summary>
[Description("AAA")]
AAA= , /// <summary>
/// BBB
/// </summary>
[Description("BBB")]
BBB=
}
调用时:
typeof(PayType).GetFields().Where(p => p.Name == “AAA”).Count() == 0