/// <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(); }
/// <summary> /// Create a new type projector /// </summary> public static TypeProjector Create(Type left, Type right, CreateProjectionsCallback callback) { return(new TypeProjector(left, right, callback)); }
/// <summary> /// Create a new type projector /// </summary> public static TypeProjector Create <TLeft, TRight>(CreateProjectionsCallback callback) { return(new TypeProjector(typeof(TLeft), typeof(TRight), callback)); }
/// <summary> /// Creates a new instance of <see cref="ProjectionEntityMapper{TEntity,TModel}"/> /// </summary> public ProjectionEntityMapper(CreateProjectionsCallback callback) { _projector = TypeProjector.Create <TEntity, TModel>(callback); }