I have an application where I get an id from the user, then "Voicetrading"+id
matches one of the values in my Enum called SipUsernames. What i want to do is to get the value that matches "Voicetrading"+id
and return it.
Is there any way by doing it passing reference type like SipUsernames.&voicetrading.ToString()
?
Code example:
foreach(var EnumCountry in Enum.GetValues(typeof(SipUsernames)))
{
string voicetrading = "Voicetrading"+id;
if (voicetrading.Equals(EnumCountry.ToString()))
{
return SipUsernames.&voicetrading.ToString();
}
}
Ps. I know SipUsernames.&voicetrading
is something stupid and doesn't work, but i didn't know how to express what i mean in another way.