Ejemplo n.º 1
0
        public ObjectMapperFactory(CacheSet mapperScopedCacheSet)
        {
            _mappingExpressionFactories = new[]
            {
                QueryProjectionExpressionFactory.Instance,
                DictionaryMappingExpressionFactory.Instance,
                EnumerableMappingExpressionFactory.Instance,
                ComplexTypeMappingExpressionFactory.Instance
            };

            _rootMappersCache = mapperScopedCacheSet.CreateScoped <IRootMapperKey, IObjectMapper>(default(RootMapperKeyComparer));
        }
Ejemplo n.º 2
0
        public NamingSettings(CacheSet mapperScopedCache)
        {
            _idMemberCache = mapperScopedCache.CreateScoped <TypeKey, Member>(default(HashCodeComparer <TypeKey>));

            _matchingNameFactories = new List <Func <Member, string> >
            {
                member => IsTypeIdentifier(member) ? "Id" : null,
                GetGetOrSetMethodName,
                GetIdentifierName
            };

            _joinedNameFactories = new List <Func <IEnumerable <string>, string> >
            {
                names => names.Join(string.Empty),
                names => names.Join(".")
            };
        }
Ejemplo n.º 3
0
 public DerivedTypesCache(CacheSet cacheSet)
 {
     _assemblies         = new List <Assembly>();
     _typesByAssembly    = cacheSet.CreateScoped <Assembly, IEnumerable <Type> >(default(HashCodeComparer <Assembly>));
     _derivedTypesByType = cacheSet.CreateScoped <Type, IList <Type> >(default(HashCodeComparer <Type>));
 }
 public ComplexTypeConstructionFactory(CacheSet mapperScopedCacheSet)
 {
     _constructorsCache = mapperScopedCacheSet.CreateScoped <ConstructionKey, Construction>();
 }
 public ComplexTypeConstructionFactory(CacheSet mapperScopedCacheSet)
 {
     _constructionInfosCache = mapperScopedCacheSet.CreateScoped <ConstructionKey, IList <IConstructionInfo> >();
     _constructionsCache     = mapperScopedCacheSet.CreateScoped <ConstructionKey, Construction>();
 }
Ejemplo n.º 6
0
 public MemberCache(CacheSet cacheSet)
 {
     _membersCache = cacheSet.CreateScoped <TypeKey, IList <Member> >(default(HashCodeComparer <TypeKey>));
 }
 public ObjectMapperFactory(CacheSet mapperScopedCacheSet)
 {
     _rootMappersCache = mapperScopedCacheSet
                         .CreateScoped <IRootMapperKey, IObjectMapper>(CompareRootMapperKeys);
 }
Ejemplo n.º 8
0
 public ObjectMapperFactory(CacheSet mapperScopedCacheSet)
 {
     _rootMappersCache = mapperScopedCacheSet.CreateScoped <IRootMapperKey, IObjectMapper>(default(RootMapperKeyComparer));
 }