I have a class called Questions
(plural). In this class there is an enum called Question
(singular) which looks like this.
public enum Question
{
Role = 2,
ProjectFunding = 3,
TotalEmployee = 4,
NumberOfServers = 5,
TopBusinessConcern = 6
}
In the Questions
class I have a get(int foo)
function that returns a Questions
object for that foo
. Is there an easy way to get the integer value off the enum so I can do something like this Questions.Get(Question.Role)
?
get(int foo)
you can define it asget(Question foo)
then do your casting inside the method, the you can call your method asQuestions.Get(Question.Role)
– Joe