Пример #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;
 }
Пример #2
0
 public PropertyMap(PathMap pathMap)
 {
     Condition           = pathMap.Condition;
     DestinationProperty = pathMap.DestinationMember;
     CustomExpression    = pathMap.SourceExpression;
     TypeMap             = pathMap.TypeMap;
 }
Пример #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;
 }
Пример #4
0
        public PropertyMap(PathMap pathMap)
        {
            DestinationProperty = pathMap.DestinationMember;
            CustomExpression    = pathMap.SourceExpression;
            TypeMap             = pathMap.TypeMap;

#if NET40
            SourceMembers = new ReadOnlyCollection <MemberInfo>(_memberChain);
#endif
        }
Пример #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);
        }
Пример #6
0
 private void AddPathMap(PathMap pathMap) => _pathMaps.Add(pathMap.MemberPath, pathMap);