I think the Enum.ToObject method will do what you want.
Type type= typeof(Foo);
object o1 = Enum.ToObject(type,GetValue());
I think the Enum.ToObject method will do what you want.
Type type= typeof(Foo);
object o1 = Enum.ToObject(type,GetValue());