コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlEventStore{TKey}"/> class.
        /// </summary>
        /// <param name="persistence">The <see cref="IPersistence">persistence</see> associated with the event store.</param>
        /// <param name="configuration">The <see cref="SqlEventStoreConfiguration">configuration</see> used by the event store.</param>
        public SqlEventStore(IPersistence persistence, SqlEventStoreConfiguration configuration) : base(persistence)
        {
            Arg.NotNull(configuration, nameof(configuration));
            Arg.NotNullOrEmpty(configuration.EntityName, nameof(configuration.EntityName));

            Configuration      = configuration;
            Snapshots          = configuration.CreateSnapshotStore <TKey>();
            snapshotSerializer = new SnapshotSerializer(typeof(TKey), configuration);
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlEventStore{TKey}"/> class.
 /// </summary>
 /// <param name="persistence">The <see cref="SqlPersistence">persistence</see> associated with the event store.</param>
 public SqlEventStore(SqlPersistence persistence) : base(persistence)
 {
     Configuration      = persistence.Configuration.Events;
     Snapshots          = Configuration.CreateSnapshotStore <TKey>();
     snapshotSerializer = new SnapshotSerializer(typeof(TKey), Configuration);
 }