I have this code to list the values of an enum:
Type myType1 = Type.GetType("QBFC16Lib.ENTxnType");
var enumList = Enum.GetValues(myType1)
.Cast<myType1>()
.Select(d => (d, (int)d))
.ToList();
I receive a compilation error in .Cast(myType1). The error is: "myType1 is variable but is used as a type"
If instead of MyType1 I use QBFC16Lib.ENTxnType in both places it works perfetly.
How can modify the code to overcome that error?