I have a class called Questions
(plural). In this class there is an enum called Question
(singular) which looks like this.
public e
The easiest solution I can think of is overloading the Get(int)
method like this:
[modifiers] Questions Get(Question q)
{
return Get((int)q);
}
where [modifiers]
can generally be same as for the Get(int)
method. If you can't edit the Questions
class or for some reason don't want to, you can overload the method by writing an extension:
public static class Extensions
{
public static Questions Get(this Questions qs, Question q)
{
return qs.Get((int)q);
}
}