public override void CreateMap(IMapperConfigurationExpression configuration, Type type) { if (TargetTypes.IsNullOrEmpty()) { return; } foreach (var targetType in TargetTypes) { configuration.CreateMap(targetType, type, MemberList); } }
public override void CreateMap(Type type) { if (TargetTypes.IsNullOrEmpty()) { return; } foreach (var targetType in TargetTypes) { Nelibur.ObjectMapper.TinyMapper.Bind(type, targetType); } }
public override void CreateMap(TypeAdapterConfig configuration, Type needstoMap) { if (TargetTypes.IsNullOrEmpty()) { return; } foreach (Type source in TargetTypes) { configuration.NewConfig(source, needstoMap); configuration.NewConfig(needstoMap, source); } }
/// <summary>创建映射 /// </summary> public override void CreateMap(IMapperConfigurationExpression configuration, Type type) { if (TargetTypes.IsNullOrEmpty()) { return; } configuration.CreateAutoAttributeMaps(type, TargetTypes, MemberList); //foreach (var targetType in TargetTypes) //{ // configuration.CreateMap(type, targetType, MemberList); //} }
public override void CreateMap(TypeAdapterConfig configuration, Type destination) { if (TargetTypes.IsNullOrEmpty()) { return; } foreach (Type source in TargetTypes) { MethodInfo mapperFunc = configuration.GetType().GetMethod("NewConfig").MakeGenericMethod(source, destination); mapperFunc.Invoke(configuration, null); } }
public override void CreateMap(MapperProfile mapperProfile, Type type) { if (TargetTypes.IsNullOrEmpty()) { return; } foreach (var targetType in TargetTypes) { mapperProfile.CreateMap(type, targetType); mapperProfile.CreateMap(targetType, type); } }
public override void CreateMap(IMapperConfigurationExpression configuration, Type type) { if (TargetTypes.IsNullOrEmpty()) { return; } configuration.CreateAutoAttributeMaps(type, TargetTypes, MemberList.Source); foreach (var targetType in TargetTypes) { configuration.CreateAutoAttributeMaps(targetType, new[] { type }, MemberList.Destination); } }
public override void CreateMap(TypeAdapterConfig configuration, Type needstoMap) { if (TargetTypes.IsNullOrEmpty()) { return; } foreach (Type source in TargetTypes) { MethodInfo mapToDestination = configuration.GetType().GetMethod("NewConfig").MakeGenericMethod(source, needstoMap); MethodInfo mapToSource = configuration.GetType().GetMethod("NewConfig").MakeGenericMethod(needstoMap, source); mapToDestination.Invoke(configuration, null); mapToSource.Invoke(configuration, null); } }
public override void CreateMap(Type type) { if (TargetTypes.IsNullOrEmpty()) { return; } foreach (var targetType in TargetTypes) { //if (targetType.FullName == "WinMS.Core.Entities.Info.BarcodeInfo") //{ // var ww = ""; //} Nelibur.ObjectMapper.TinyMapper.Bind(type, targetType); Nelibur.ObjectMapper.TinyMapper.Bind(targetType, type); } }
public override void CreateMap(IMapperConfigurationExpression configuration, Type type) { if (TargetTypes.IsNullOrEmpty()) { return; } foreach (var targetType in TargetTypes) { var configMap = configuration.CreateMap(targetType, type, MemberList.Destination); if (selfMemberOptions != null) { foreach (var selfMemberOption in selfMemberOptions) { configMap.ForMember(selfMemberOption.Key, selfMemberOption.Value); } } } }
/// <summary> /// 创建映射 /// </summary> /// <param name="configuration"></param> /// <param name="type">打标签的类</param> public override void CreateMap(IMapperConfigurationExpression configuration, Type type) { /* * * [AutoMap(TypeOf(Person),TypeOf(Chinese))] * public class Student{} * * 这里参数的type就是Student,targetTypes就是 Person,Chinese等 */ if (TargetTypes.IsNullOrEmpty()) { return; } //当前类映射到模板类上,当前类是source configuration.CreateAutoAttributeMaps(type, TargetTypes, MemberList.Source); //遍历所有的目标类,映射到当前类上,当前类是Destination foreach (var targetType in TargetTypes) { configuration.CreateAutoAttributeMaps(targetType, new[] { type }, MemberList.Destination); } }
public override void CreateMap(IMapperConfigurationExpression configuration, Type type) { if (TargetTypes.IsNullOrEmpty()) { } }