コード例 #1
0
        public ObjectMapperFactory(CacheSet mapperScopedCacheSet)
        {
            _mappingExpressionFactories = new[]
            {
                QueryProjectionExpressionFactory.Instance,
                DictionaryMappingExpressionFactory.Instance,
                EnumerableMappingExpressionFactory.Instance,
                ComplexTypeMappingExpressionFactory.Instance
            };

            _rootMappersCache = mapperScopedCacheSet.CreateScoped <IRootMapperKey, IObjectMapper>(default(RootMapperKeyComparer));
        }
コード例 #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(".")
            };
        }
コード例 #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>));
 }
コード例 #4
0
 public ComplexTypeConstructionFactory(CacheSet mapperScopedCacheSet)
 {
     _constructorsCache = mapperScopedCacheSet.CreateScoped <ConstructionKey, Construction>();
 }
コード例 #5
0
 public ComplexTypeConstructionFactory(CacheSet mapperScopedCacheSet)
 {
     _constructionInfosCache = mapperScopedCacheSet.CreateScoped <ConstructionKey, IList <IConstructionInfo> >();
     _constructionsCache     = mapperScopedCacheSet.CreateScoped <ConstructionKey, Construction>();
 }
コード例 #6
0
 public MemberCache(CacheSet cacheSet)
 {
     _membersCache = cacheSet.CreateScoped <TypeKey, IList <Member> >(default(HashCodeComparer <TypeKey>));
 }
コード例 #7
0
 public ObjectMapperFactory(CacheSet mapperScopedCacheSet)
 {
     _rootMappersCache = mapperScopedCacheSet
                         .CreateScoped <IRootMapperKey, IObjectMapper>(CompareRootMapperKeys);
 }
コード例 #8
0
 public ObjectMapperFactory(CacheSet mapperScopedCacheSet)
 {
     _rootMappersCache = mapperScopedCacheSet.CreateScoped <IRootMapperKey, IObjectMapper>(default(RootMapperKeyComparer));
 }