Exemplo n.º 1
0
 /// <summary>
 /// Create a new instance of <see cref="TypeProjector"/>
 /// </summary>
 protected TypeProjector(Type left, Type right, CreateProjectionsCallback callback)
 {
     if (left == null)
     {
         throw new ArgumentNullException(nameof(left));
     }
     if (right == null)
     {
         throw new ArgumentNullException(nameof(right));
     }
     if (callback == null)
     {
         throw new ArgumentNullException(nameof(callback));
     }
     Projections = callback.Invoke(left, right).ToList();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Create a new type projector
 /// </summary>
 public static TypeProjector Create(Type left, Type right, CreateProjectionsCallback callback)
 {
     return(new TypeProjector(left, right, callback));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Create a new type projector
 /// </summary>
 public static TypeProjector Create <TLeft, TRight>(CreateProjectionsCallback callback)
 {
     return(new TypeProjector(typeof(TLeft), typeof(TRight), callback));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a new instance of <see cref="ProjectionEntityMapper{TEntity,TModel}"/>
 /// </summary>
 public ProjectionEntityMapper(CreateProjectionsCallback callback)
 {
     _projector = TypeProjector.Create <TEntity, TModel>(callback);
 }