Lets say that MyEnum looks like this:
public enum MyEnum
{
First = 1,
Second,
Third
}
and that the JValue is defined like this:
var value = new JValue(MyEnum.First);
When you make call to the following line:
object o1 = value.ToObject(typeof(MyEnum));
you are making a call to the non-generic overload of ToObject method. This method, in the case of enums, resolves the underlying type of the enum, which in this case is int and casts the object to that value. That's why it returns numeric value. (1 in this case).
When you make a call to the generic overload of ToObject method:
object o2 = value.ToObject<MyEnum>();
the result is obtained from the JValue and it is 1 again, but before returning the value, it is casted to the type of the generic type parameter.
To be more clear, here is how the generic overload of ToObject method looks like:
public T ToObject<T>()
{
return (T)ToObject(typeof(T));
}
It calls the non-generic overload (which we used in the first case), but it casts the result to T before returning it. That's why in the first case we get numeric and in the second case enum value.