I have created some enums as .dll dynamically using data from database.
I am looking a way to get the values of enum to a list.
I can access each value separately when I add the reference from each .dll to project
eg. MyEnum.value1
I tried using Type.GetMembers to get values, but no luck.
Is there any way I can get all the values in enum to a list?
Update
I also try Enum.GetValues() but it comes up with an error
‘EnumeratedTypes.MyEnum’ is a ‘type’ but is used like a ‘variable’
Thanks
Use
Enum.GetValues(typeof(EnumeratedTypes.MyEnum))