public PathMap(PathMap pathMap, TypeMap typeMap, IncludedMember includedMember) : this(pathMap.DestinationExpression, pathMap.MemberPath, typeMap) { IncludedMember = includedMember.Chain(pathMap.IncludedMember); CustomMapExpression = pathMap.CustomMapExpression; Condition = pathMap.Condition; Ignored = pathMap.Ignored; }
private void ApplyIncludedMemberTypeMap(IncludedMember includedMember) { var typeMap = includedMember.TypeMap; var memberMaps = typeMap.PropertyMaps. Where(m => m.CanResolveValue && GetPropertyMap(m) == null) .Select(p => new PropertyMap(p, this, includedMember)) .ToList(); var notOverridenPathMaps = NotOverridenPathMaps(typeMap); if (memberMaps.Count == 0 && notOverridenPathMaps.Count == 0) { return; } memberMaps.ForEach(p => { AddPropertyMap(p); foreach (var transformer in typeMap.ValueTransformers) { p.AddValueTransformation(transformer); } }); _beforeMapActions.UnionWith(typeMap._beforeMapActions.Select(includedMember.Chain)); _afterMapActions.UnionWith(typeMap._afterMapActions.Select(includedMember.Chain)); notOverridenPathMaps.ForEach(p => AddPathMap(new PathMap(p, this, includedMember) { CustomMapExpression = p.CustomMapExpression })); }
private void ApplyMemberMaps(TypeMap currentMap, IConfigurationProvider configurationProvider) { foreach (var includedMemberExpression in currentMap.GetAllIncludedMembers()) { var includedMap = configurationProvider.GetIncludedTypeMaps(new[] { new TypePair(includedMemberExpression.Body.Type, currentMap.DestinationType) }).Single(); var includedMember = new IncludedMember(includedMap, includedMemberExpression); if (currentMap.AddMemberMap(includedMember)) { ApplyMemberMaps(includedMap, configurationProvider); foreach (var inheritedIncludedMember in includedMap.IncludedMembersTypeMaps) { currentMap.AddMemberMap(includedMember.Chain(inheritedIncludedMember)); } } } }
public PropertyMap(PropertyMap includedMemberMap, TypeMap typeMap, IncludedMember includedMember) : this(includedMemberMap, typeMap) => IncludedMember = includedMember.Chain(includedMemberMap.IncludedMember);
public bool AddMemberMap(IncludedMember includedMember) => _includedMembersTypeMaps.Add(includedMember);
public PropertyMap( PropertyMap includedMemberMap, TypeMap typeMap, IncludedMember includedMember ) : this(includedMemberMap, typeMap) =>