I have a method such as:
public void DoIt(params MyEnum[] channels)
{
}
Is there a way to get the int values of the enums in the params?
I tried var myInts = channels.Select(x => x.Value) but no luck
var myInts = channels.Cast<int>();
You can do a cast in the select clause:
var myInts = channels.Select(x => (int)x);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With