/// <summary>
        /// Initializes a new instance of <see cref="SqlSnapshotStore"/> with a custom <see cref="ISnapshotStoreDialect"/>.
        /// </summary>
        /// <param name="serializer">The <see cref="ISerializeObjects"/> used to store binary data.</param>
        /// <param name="settings">The snapshot store settings.</param>
        /// <param name="dialect">The database dialect associated with this <see cref="SqlSnapshotStore"/>.</param>
        internal SqlSnapshotStore(ISnapshotStoreDialect dialect, ISerializeObjects serializer, IStoreSnapshotSettings settings)
        {
            Verify.NotNull(serializer, nameof(serializer));
            Verify.NotNull(settings, nameof(settings));
            Verify.NotNull(dialect, nameof(dialect));

            this.dialect = dialect;
            this.serializer = serializer;
            this.useAsyncWrite = settings.Async;
            this.replaceExisting = settings.ReplaceExisting;
            this.buffer = settings.Async ? CreateBuffer(settings, dialect) : null;

            Initialize();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of <see cref="SqlEventStore"/> with a custom <see cref="IEventStoreDialect"/>.
        /// </summary>
        /// <param name="dialect">The database dialect associated with this <see cref="SqlEventStore"/>.</param>
        /// <param name="serializer">The <see cref="ISerializeObjects"/> used to store binary data.</param>
        /// <param name="settings">The event store settings.</param>
        internal SqlEventStore(IEventStoreDialect dialect, ISerializeObjects serializer, IStoreEventSettings settings)
        {
            Verify.NotNull(serializer, nameof(serializer));
            Verify.NotNull(settings, nameof(settings));
            Verify.NotNull(dialect, nameof(dialect));

            this.dialect = dialect;
            this.serializer = serializer;
            this.pageSize = settings.PageSize;
            this.useAsyncWrite = settings.Async;
            this.detectDuplicateCommits = settings.DetectDuplicateCommits;
            this.dispatchedBuffer = settings.Async ? CreateBuffer(settings, dialect) : null;

            Initialize();
        }