public ConstructionKey(IObjectMappingData mappingData) { MappingData = mappingData; _ruleSet = mappingData.MappingContext.RuleSet; _sourceMember = mappingData.MapperData.SourceMember; _targetMember = mappingData.MapperData.TargetMember; }
public MapperCreationCallbackKey( MappingRuleSet ruleSet, Type sourceType, Type targetType) { _ruleSet = ruleSet; _sourceType = sourceType; _targetType = targetType; }
public static ExpressionInfoFinder.ExpressionInfo GetExpressionInfoFor( this MappingRuleSet ruleSet, Expression value, ExpressionInfoFinder infoFinder = null, bool targetCanBeNull = false) { return(ruleSet.Settings?.GuardAccessTo(value) != false ? (infoFinder ?? ExpressionInfoFinder.Default).FindIn(value, targetCanBeNull) : ExpressionInfoFinder.EmptyExpressionInfo); }
public BasicMapperData( MappingRuleSet ruleSet, Type sourceType, Type targetType, IQualifiedMember sourceMember, QualifiedMember targetMember, IBasicMapperData parent) : this(ruleSet, sourceType, targetType, targetMember, parent) { SourceMember = sourceMember; }
private static Expression GetNestedAccessChecksFor( Expression value, MappingRuleSet ruleSet, IMemberMapperData mapperData) { if (ruleSet.Settings?.GuardAccessTo(value) == false) { return(null); } return(NestedAccessChecksFactory.GetNestedAccessChecksFor(value, mapperData)); }
public BasicMapperData( MappingRuleSet ruleSet, Type sourceType, Type targetType, QualifiedMember targetMember, IBasicMapperData parent = null) { IsRoot = parent == null; _parent = parent; SourceType = sourceType; TargetType = targetType; RuleSet = ruleSet; TargetMember = targetMember ?? QualifiedMember.All; }
private MappingPlan GetMappingPlan <TTarget>( MappingRuleSet ruleSet, ICollection <Expression <Action <IFullMappingInlineConfigurator <TSource, TTarget> > > > configurations) { var planContext = new SimpleMappingContext(ruleSet, _mapperContext) { IgnoreUnsuccessfulMemberPopulations = false }; return(GetMappingPlan( planContext, ObjectMappingDataFactory.ForRootFixedTypes <TSource, TTarget>, configurations)); }
public QualifiedMemberContext( MappingRuleSet ruleSet, Type sourceType, Type targetType, IQualifiedMember sourceMember, QualifiedMember targetMember, IQualifiedMemberContext parent, MapperContext mapperContext) : this( ruleSet, sourceType, targetType, targetMember, parent, mapperContext) { SourceMember = sourceMember.SetContext(this); }
private static MapperContext ConfigureMapperContext <TConfigurator>( IEnumerable <Expression <Action <TConfigurator> > > configurations, Func <MappingConfigInfo, TConfigurator> configuratorFactory, MappingRuleSet ruleSet, MapperContext mapperContext) { var configInfo = new MappingConfigInfo(mapperContext) .ForRuleSet(ruleSet) .ForSourceType <TSource>() .ForTargetType <TTarget>(); var configurator = configuratorFactory.Invoke(configInfo); foreach (var configuration in configurations) { configuration.Compile().Invoke(configurator); } return(mapperContext); }
protected MemberMapperDataBase( MappingRuleSet ruleSet, IQualifiedMember sourceMember, QualifiedMember targetMember, ObjectMapperData parent, MapperContext mapperContext) : base( ruleSet, sourceMember.Type, targetMember.Type, sourceMember, targetMember, parent, mapperContext) { Parent = parent; MappingDataObject = CreateMappingDataObject(); MappingDataType = typeof(IMappingData <,>).MakeGenericType(SourceType, TargetType); SourceObject = GetMappingDataProperty(MappingDataType, Member.RootSourceMemberName); TargetObject = GetMappingDataProperty(Member.RootTargetMemberName); }
public QualifiedMemberContext( MappingRuleSet ruleSet, Type sourceType, Type targetType, QualifiedMember targetMember, IQualifiedMemberContext parent, MapperContext mapperContext) { if (parent == null) { IsRoot = true; } else { _parent = parent; } SourceType = sourceType; TargetType = targetType; RuleSet = ruleSet; MapperContext = mapperContext; TargetMember = (targetMember?.SetContext(this)) ?? QualifiedMember.All; }
public MappingConfigInfo ForRuleSet(string ruleSetName) { _mappingRuleSet = MapperContext.RuleSets.GetByName(ruleSetName); return(this); }
public static Expression GetNestedAccessChecksFor(this MappingRuleSet ruleSet, Expression value) => GetNestedAccessChecksFor(value, ruleSet, mapperData: null);
private RootObjectMapperKey(MappingRuleSet ruleSet, MappingTypes mappingTypes, MapperContext mapperContext) : base(mappingTypes) { _mapperContext = mapperContext; _ruleSet = ruleSet; }
private string GetMappingPlan <TTarget>(MappingRuleSet ruleSet) { var planContext = new MappingExecutor <TSource>(ruleSet, _mapperContext); return(new MappingPlan <TSource, TTarget>(planContext)); }
public SimpleMappingContext(MappingRuleSet ruleSet, MapperContext mapperContext) { RuleSet = ruleSet; MapperContext = mapperContext; }
public MappingConfigInfo ForRuleSet(MappingRuleSet ruleSet) { RuleSet = ruleSet; return(this); }
public bool Supports(MappingRuleSet ruleSet) => ruleSet.Settings?.ExpressionIsSupported(_lambda) != false;
public RootObjectMapperKey(MappingRuleSet ruleSet, MappingTypes mappingTypes, IMembersSource membersSource) : base(mappingTypes) { _membersSource = membersSource; RuleSet = ruleSet; }
public bool ConditionSupports(MappingRuleSet ruleSet) => _conditionLambda.Supports(ruleSet);
public SimpleMappingContext(MappingRuleSet ruleSet, MapperContext mapperContext) { MapperContext = mapperContext; RuleSet = ruleSet; IgnoreUnsuccessfulMemberPopulations = true; }
public bool IsFor(MappingRuleSet mappingRuleSet) => (RuleSet == _allRuleSets) || (mappingRuleSet == _allRuleSets) || (mappingRuleSet == RuleSet);
public bool IsFor(MappingRuleSet mappingRuleSet) => (RuleSet == All) || (mappingRuleSet == All) || (mappingRuleSet == RuleSet);