我有这样一个枚举:
public enum PromotionTypes
{
Unspecified = 0,
InternalEvent = 1,
ExternalEvent = 2,
GeneralMailing = 3,
VisitBased = 4,
PlayerIntroduction = 5,
Hospitality = 6
}
我想判断一下这个枚举是否包含我给出的数字.例如:当我给出4时,Enum包含它,所以我想返回True,如果我给7,那么这个Enum中没有7,所以它返回False. 我try 了Enum.IsDefine,但它只判断字符串值. 我怎么才能做到这一点呢?