This is my declaration.
public enum Egypt {
Cairo = (long)1521894,
Alexandria = (long)1522006,
Giza = (long)1521643
}
From aspx page I get the value Egypt
as a query-string
. With this value I want to parse the names and values of this enumeration Egypt
.
var values = Enum.GetValues(typeof(Egypt)).Cast<Egypt>();
foreach (Egypt in values)
{
long woeid = ((long)(Egypt)(s));
}
I have the code to get the values like this but my point is the value enum - Egypt is itself determined at runtime. How will I achieve it?