I think this question needs some code:
private TypeValues GetEnumValues(Type enumType, string description) { TypeValues wtv = new TypeValues(); wtv.TypeValueDescription = description; List<string> values = Enum.GetNames(enumType).ToList(); foreach (string v in values) {
Name it as follows:
GetEnumValues(typeof(AanhefType), "some name");
In the GetEnumValues function, I have enumeration values. So I repeat the values โโand want to get the integer value of this enum value.
So my values โโare โredโ and โgreenโ, and I also want to get 0 and 1.
When I have Enum in my function, I can create an enumeration value from a string and pass it to this enumeration, and then pass it to int, but in this case I do not have the enum itself, but only the type of the enumeration.
I tried passing in the actual enumeration as a parameter too, but I am not allowed to pass enum as a parameter.
So now I'm stuck .....
source share