public void SyncSomething <T>(IEventStore remoteEventStore, Guid aggregateId) where T : class, IAggregateRoot, new() { var scope = this.BeginUnitOfWork(); using (scope) { var syncAgent = new SyncAgent( scope.GetRegisteredObject <IMergableEventStore>(), remoteEventStore, scope.GetRegisteredObject <IRepository <ISyncState> >(), scope.GetRegisteredObject <IPendingCommandRepository>(), scope.GetRegisteredObject <ISnapshotRepository>()); if (syncAgent.SyncWithRemote <T>(aggregateId)) { scope.GetRegisteredObject <IReadModelQueueProducer>().Enqueue(aggregateId, AggregateRootBase.GetAggregateTypeDescriptor <T>(), 0); if (this.BuilderAgent != null && this.BuilderAgent.IsStarted) { this.BuilderAgent.Trigger(); } } scope.Commit(); } }