예제 #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();
 }
예제 #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));
 }
예제 #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));
 }
예제 #4
0
 /// <summary>
 /// Creates a new instance of <see cref="ProjectionEntityMapper{TEntity,TModel}"/>
 /// </summary>
 public ProjectionEntityMapper(CreateProjectionsCallback callback)
 {
     _projector = TypeProjector.Create <TEntity, TModel>(callback);
 }