Ejemplo n.º 1
0
        // Constructors

        internal Domain(DomainConfiguration configuration, object upgradeContextCookie, SqlConnection singleConnection, DefaultSchemaInfo defaultSchemaInfo)
        {
            Configuration                = configuration;
            Handlers                     = new HandlerAccessor(this);
            GenericKeyFactories          = new ConcurrentDictionary <TypeInfo, GenericKeyFactory>();
            RecordSetReader              = new RecordSetReader(this);
            KeyGenerators                = new KeyGeneratorRegistry();
            PrefetchFieldDescriptorCache = new ConcurrentDictionary <TypeInfo, ReadOnlyList <PrefetchFieldDescriptor> >();
            KeyCache                     = new LruCache <Key, Key>(Configuration.KeyCacheSize, k => k);
            QueryCache                   = new LruCache <object, Pair <object, TranslatedQuery> >(Configuration.QueryCacheSize, k => k.First);
            PrefetchActionMap            = new Dictionary <TypeInfo, Action <SessionHandler, IEnumerable <Key> > >();
            Extensions                   = new ExtensionCollection();
            UpgradeContextCookie         = upgradeContextCookie;
            SingleConnection             = singleConnection;
            StorageNodeManager           = new StorageNodeManager(Handlers);
        }
Ejemplo n.º 2
0
        // Constructors

        internal Domain(DomainConfiguration configuration, object upgradeContextCookie, SqlConnection singleConnection)
        {
            Configuration                = configuration;
            Handlers                     = new HandlerAccessor(this);
            GenericKeyFactories          = new ConcurrentDictionary <TypeInfo, GenericKeyFactory>();
            EntityDataReader             = new EntityDataReader(this);
            KeyGenerators                = new KeyGeneratorRegistry();
            PrefetchFieldDescriptorCache = new ConcurrentDictionary <TypeInfo, ReadOnlyList <PrefetchFieldDescriptor> >();
            KeyCache                     = new LruCache <Key, Key>(Configuration.KeyCacheSize, k => k);
            QueryCache                   = new FastConcurrentLruCache <object, Pair <object, ParameterizedQuery> >(Configuration.QueryCacheSize, k => k.First);
            PrefetchActionMap            = new Dictionary <TypeInfo, Action <SessionHandler, IEnumerable <Key> > >();
            Extensions                   = new ExtensionCollection();
            UpgradeContextCookie         = upgradeContextCookie;
            SingleConnection             = singleConnection;
            StorageNodeManager           = new StorageNodeManager(Handlers);
            isDebugEventLoggingEnabled   = OrmLog.IsLogged(LogLevel.Debug); // Just to cache this value
        }