Пример #1
0
 /// <summary>
 /// Register a conversion strategy for a single type by a Func
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="finder"></param>
 public void RegisterConverter <T>(Func <string, T> finder, string description = null)
 {
     _froms[typeof(T)] = new LambdaConverterStrategy <T>(finder, description);
 }
Пример #2
0
 /// <summary>
 /// Register a conversion strategy for a single type TReturnType that uses
 /// an instance of a service type TService
 /// </summary>
 /// <typeparam name="TReturnType"></typeparam>
 /// <typeparam name="TService"></typeparam>
 /// <param name="converter"></param>
 public void RegisterConverter <TReturnType, TService>(Func <TService, string, TReturnType> converter, string description = null)
 {
     _froms[typeof(TReturnType)] = new LambdaConverterStrategy <TReturnType, TService>(converter, description);
 }
Пример #3
0
 /// <summary>
 /// Register a conversion strategy for a single type by a Func
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="finder"></param>
 public void RegisterConverter <T>(Func <string, T> finder)
 {
     _froms[typeof(T)] = new LambdaConverterStrategy <T>(finder);
 }