For C# in VS2005, is there way to check if an integer is part of a Enum type?
eg:
if number in CustomerType { ... }
where
enum CustomerType
{
A = 0;
B = 1;
C = 2;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Is Enum.IsDefined(Type enumType, Object value) what you’re looking for?
Instead of your if-statement: