public override IUnitOfWorkScope BeginUnitOfWork() { var connection = new SQLiteConnection(this.ConnectionString, true); var scope = new SqlUnitOfWorkScope(connection); scope.RegisterObject <IEventStore>(new EventStore(connection, this.EventSerializer)); if (this.CommandSerializer != null) { scope.RegisterObject <IPendingCommandRepository>(new PendingCommandRepository(connection, this.CommandSerializer)); scope.RegisterObject <IRepository <ISyncState> >(new SyncStateRepository(connection)); } if (this.SnapshotSerializer != null) { scope.RegisterObject <ISnapshotRepository>(new SnapshotRepository(connection, this.SnapshotSerializer)); } if (!string.IsNullOrWhiteSpace(this.ReadModelConnectionString)) { if (this.readModelQueue == null) { this.readModelQueue = new ReadModelBuilderQueue(this.readModelConnection); } scope.RegisterObject <IReadModelQueueProducer>(this.readModelQueue); } return(scope); }
public override IUnitOfWorkScope BeginUnitOfWork() { var connection = new SQLiteConnection(this.ConnectionString, true); var scope = new SqlUnitOfWorkScope(connection); scope.RegisterObject<SQLiteConnection>(connection); scope.RegisterObject<ISnapshotRepository>(new SnapshotRepository(connection, this.SnapshotSerializer)); return scope; }
public override IUnitOfWorkScope BeginUnitOfWork() { var connection = new SQLiteConnection(this.ConnectionString, true); var scope = new SqlUnitOfWorkScope(connection); scope.RegisterObject <SQLiteConnection>(connection); scope.RegisterObject <ISnapshotRepository>(new SnapshotRepository(connection, this.SnapshotSerializer)); return(scope); }