protected virtual IMapper <TSource, TTarget> CreateMapper <TSource, TTarget>( Type targetType) { Guard.CheckArgumentNotNull(targetType, "targetType"); if (targetType.GetConstructor(new Type[] { typeof(MapperConstructionInfo) }) != null) { var info = new MapperConstructionInfo(this); return((IMapper <TSource, TTarget>)Activator .CreateInstance(targetType, new object[] { info })); } return((IMapper <TSource, TTarget>)Activator.CreateInstance(targetType)); }
/// <summary> /// Initializes a new instance of the <see cref="ConfigurationMapper{TSource,TTarget}" /> class. /// </summary> /// <param name="constructionInfo">Mapper construction information.</param> public ConfigurationMapper(MapperConstructionInfo constructionInfo) : base(constructionInfo) { }
/// <summary> /// Initializes a new instance of the <see cref="CompositeMapper{TSource,TTarget}" /> class. /// </summary> /// <param name="constructionInfo"> /// Mapper construction information. /// </param> /// <param name="innerMappers"> /// The inner mappers. /// </param> public CompositeMapper(MapperConstructionInfo constructionInfo, params IMapper <TSource, TTarget>[] innerMappers) : base(constructionInfo) { Initialize(innerMappers); TypeMapping = new TypeMappingInfo <TSource, TTarget>(MappingOverwriteBehavior.SkipOverwrite); }
/// <summary> /// Initializes a new instance of the <see cref="AttributeMapper{TSource,TTarget}" /> class. /// </summary> /// <param name="constructionInfo">Mapper construction information.</param> public AttributeMapper(MapperConstructionInfo constructionInfo) : base(constructionInfo) { }
/// <summary> /// Initializes a new instance of the <see cref="ManualMapper{TSource,TTarget}" /> class. /// </summary> /// <param name="constructionInfo">Mapper construction information.</param> public ManualMapper(MapperConstructionInfo constructionInfo) : base(constructionInfo) { TypeMapping = new TypeMappingInfo <TSource, TTarget>(); }
public Mapper2(MapperConstructionInfo constructionInfo) { this.ConstructionInfo = constructionInfo; }
/// <summary> /// Initializes a new instance of the <see cref="ConventionMapper{TSource,TTarget}"/> class. /// </summary> /// <param name="constructionInfo">Mapper construction information.</param> public ConventionMapper(MapperConstructionInfo constructionInfo) : base(constructionInfo) { }
/// <summary> /// Initializes a new instance of the <see cref="BaseMapper{TSource,TTarget}"/> class. /// </summary> /// <param name="constructionInfo"> /// Contains additional mapper construction information. /// </param> protected BaseMapper(MapperConstructionInfo constructionInfo) : this() { Guard.CheckArgumentNotNull(constructionInfo, "constructionInfo"); this.ParentRepository = constructionInfo.ParentRepo; }