Ejemplo n.º 1
0
 public static void LoadConverters <TContext>(this IResourceMapper <TContext> resourceMapper, Type type)
 {
     resourceMapper.LoadConverters(type, method => true);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Loads standard type converters from the System.Convert class.  This detects all methods that start with
 /// "To", and have a single input and a single output
 /// </summary>
 /// <param name="resourceMapper">
 /// A <see cref="IResourceMapper<TContext>"/>
 /// </param>
 public static void LoadStandardConverters <TContext>(this IResourceMapper <TContext> resourceMapper)
 {
     resourceMapper.LoadConverters(typeof(Convert), method => method.Name.StartsWith("To") &&
                                   !((method.ReturnType.IsValueType || method.ReturnType == typeof(string)) && method.ReturnType == method.GetParameters()[0].ParameterType));
 }