Is it possible to create a general function in C # where the first parameter is an enumeration (one of several, so it should be general, I think), and the second parameter should be the value from the enumeration selected as the first parameter? I understand that you need to use generics, but I can not figure out how to write such an expression, or if it is possible.
Edit: added code example. I know that this code example does not work, but it illustrates a little the direction I was thinking.
public List<int> Call<EnumValue>(Type enumType, EnumValue enumValue) where EnumValue : Enum.GetValues(typeof(enumType)) {
Ohlin source share