Exemple #1
0
 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;
 }
Exemple #2
0
 public PropertyMap(PathMap pathMap)
 {
     Condition           = pathMap.Condition;
     DestinationProperty = pathMap.DestinationMember;
     CustomExpression    = pathMap.SourceExpression;
     TypeMap             = pathMap.TypeMap;
 }
Exemple #3
0
 public PathMap(PathMap pathMap, TypeMap typeMap, LambdaExpression customSource) : this(pathMap.DestinationExpression, pathMap.MemberPath, typeMap)
 {
     CustomSource        = customSource;
     CustomMapExpression = pathMap.CustomMapExpression;
     Condition           = pathMap.Condition;
     Ignored             = pathMap.Ignored;
 }
Exemple #4
0
        public PropertyMap(PathMap pathMap)
        {
            DestinationProperty = pathMap.DestinationMember;
            CustomExpression    = pathMap.SourceExpression;
            TypeMap             = pathMap.TypeMap;

#if NET40
            SourceMembers = new ReadOnlyCollection <MemberInfo>(_memberChain);
#endif
        }
Exemple #5
0
        public PathMap FindOrCreatePathMapFor(LambdaExpression destinationExpression, MemberPath path, TypeMap typeMap)
        {
            var pathMap = _pathMaps.SingleOrDefault(p => p.MemberPath == path);

            if (pathMap == null)
            {
                pathMap = new PathMap(destinationExpression, path, typeMap);
                _pathMaps.Add(pathMap);
            }
            return(pathMap);
        }
Exemple #6
0
 private void AddPathMap(PathMap pathMap) => _pathMaps.Add(pathMap.MemberPath, pathMap);