Пример #1
0
        /// <summary>
        /// Creates a new instance of the event store
        /// </summary>
        /// <param name="connectionString">The connection string of document store to be used by the instance</param>
        /// <param name="eventDispatcher">The event dispatcher to be used by the instance</param>
        public SqlServerEventStore(string connectionString, IEventDispatcher eventDispatcher) : base(eventDispatcher)
        {
            if (string.IsNullOrWhiteSpace(connectionString))
            {
                throw new ArgumentException(nameof(connectionString));
            }

            this.Settings = new Configuration.Settings(connectionString);

            DatabaseHelper.CreateDatabaseIfNotExists(this.Settings.ConnectionString);
        }
Пример #2
0
        /// <summary>
        /// Creates a new instance of the event store
        /// </summary>
        /// <param name="settings">The document store settings to be used by the instance</param>
        /// <param name="eventDispatcher">The event dispatcher to be used by the instance</param>
        public SqlServerEventStore(Configuration.Settings settings, IEventDispatcher eventDispatcher) : base(eventDispatcher)
        {
            this.Settings = settings ?? throw new ArgumentNullException(nameof(settings));

            DatabaseHelper.CreateDatabaseIfNotExists(this.Settings.ConnectionString);
        }