private static MethodInfo GetConversionMethod(this IValue source, IUnit unit) { var methods = source.GetConversionMethods(); return(methods.SingleOrDefault(mi => mi.GetParameters().First().ParameterType == unit.GetType())); }
private static IEnumerable <Type> GetConversions(this IValue source) { var methods = source.GetConversionMethods(); return(methods.Select(mi => mi.GetParameters().First().ParameterType)); }