Helper for easy and elegant type conversions, taking care of nullables, enums, System.DBNull and other types inherit from System.IConvertible. The method tries to convert to the specified type; if the conversion fails, there is an option to define a fallback value to be returned as a result.
int converted = someObject.ConvertToOrDefault(-1);