コード例 #1
0
ファイル: DocumentStore.cs プロジェクト: forki/Marten
        /// <summary>
        /// Creates a new DocumentStore with the supplied StoreOptions
        /// </summary>
        /// <param name="options"></param>
        public DocumentStore(StoreOptions options)
        {
            options.CreatePatching();

            _options           = options;
            _connectionFactory = options.ConnectionFactory();

            _logger = options.Logger();

            Schema = new DocumentSchema(_options, _connectionFactory, _logger);

            _serializer = options.Serializer();

            var cleaner = new DocumentCleaner(_connectionFactory, Schema.As <DocumentSchema>());

            Advanced = new AdvancedOptions(cleaner, options, _serializer, Schema);

            Diagnostics = new Diagnostics(Schema);


            CreateDatabaseObjects();

            Transform = new DocumentTransforms(this, _connectionFactory);

            options.InitialData.Each(x => x.Populate(this));


            if (options.AutoCreateSchemaObjects != AutoCreate.None)
            {
                Schema.As <DocumentSchema>().RebuildSystemFunctions();
            }
        }
コード例 #2
0
        /// <summary>
        /// Creates a new DocumentStore with the supplied StoreOptions
        /// </summary>
        /// <param name="options"></param>
        public DocumentStore(StoreOptions options)
        {
            _options           = options;
            _connectionFactory = options.ConnectionFactory();

            _logger = options.Logger();

            Schema = new DocumentSchema(_options, _connectionFactory, _logger);


            _serializer = options.Serializer();

            var cleaner = new DocumentCleaner(_connectionFactory, Schema.As <DocumentSchema>());

            Advanced = new AdvancedOptions(cleaner, options, _serializer, Schema);

            Diagnostics = new Diagnostics(Schema);


            CreateDatabaseObjects();

            Transform = new DocumentTransforms(this);

            options.InitialData.Each(x => x.Populate(this));
        }
コード例 #3
0
        /// <summary>
        /// Creates a new DocumentStore with the supplied StoreOptions
        /// </summary>
        /// <param name="options"></param>
        public DocumentStore(StoreOptions options)
        {
            _options           = options;
            _connectionFactory = options.ConnectionFactory();

            _logger = options.Logger();

            Schema = new DocumentSchema(_options, _connectionFactory, _logger);


            _serializer = options.Serializer();

            var cleaner = new DocumentCleaner(_connectionFactory, Schema.As <DocumentSchema>());

            Advanced = new AdvancedOptions(cleaner, options, _serializer, Schema);

            Diagnostics = new Diagnostics(Schema);

            EventStore = new EventStoreAdmin(Schema, _connectionFactory, _options, _serializer);

            CreateDatabaseObjects();
        }