I could write the following to convert an object to an integer.
Convert.ToInt32(myObject);
But I could also write
Int.Parse
This how Convert.ToInt32 method source looks like
Convert.ToInt32
public static int ToInt32(object value) { return value == null? 0: ((IConvertible)value).ToInt32(null); }
As long as your object implement IConvertible interface you should call this method.
IConvertible