enum MyEnum
{
type1,
type2,
type3
}
public void MyMethod<T>()
{
...
}
How to make forach on enum to fire MyMethod<T> on every enum?
I try something with
foreach (MyEnum type in Enum.GetValues(typeof(MyEnum)))
{...}
But still don’t know how to use this type inside foreach with
MyMethod<T> as T
Is this what you are trying to do?
Writes to the console: