Whenever i goes into reflection or checking the T of my generic class i'm going to use a dictionary Dictionary. As value i always put something in that should be done for each time as Func or Action. In your case i would write it maybe in that way:
public static class MyConverter
private static Dictionary> _MyConverter;
_MyConverter = new Dictionary>();
//Use the Add() method to include a lambda with the proper signature.
_MyConverter.Add(typeof(int), (source) => Convert.ToInt32 (source.ToString()));
//Use the index operator to include a lambda with the proper signature.
_MyConverter[typeof(double)] = (source) => Convert.ToDouble(source.ToString());
//Use the Add() method to include a more complex lambda using curly braces.
_MyConverter.Add(typeof(decimal), (source) =>
//Use the index operator to include a function with the proper signature.
_MyConverter[typeof(float)] = MySpecialConverterFunctionForFloat;
//A function that does some more complex conversion which is simply unreadable as lambda.
private static object MySpecialConverterFunctionForFloat(object source)
var something = source as float?;
if (something != null
public static TDestination As(this object source, TDestination defaultValue = default(TDestination))
//Do some parameter checking (if needed).
if (source == null)
throw new ArgumentNullException("source");
//The fast-path exit.