/// <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(); } }
/// <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)); }
/// <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(); }