public async Task <IAggregateRoot> RestoreFromSnapshotAsync(Type aggregateRootType, string aggregateRootId) { var aggregateRepository = _aggregateRepositoryProvider.GetRepository(aggregateRootType); if (aggregateRepository != null) { return(await TryGetAggregateAsync(aggregateRepository, aggregateRootType, aggregateRootId, 0, new TaskCompletionSource <IAggregateRoot>()).ConfigureAwait(false)); } return(null); }
public async Task <IAggregateRoot> RestoreFromSnapshotAsync(Type aggregateRootType, string aggregateRootId) { var aggregateRepository = _aggregateRepositoryProvider.GetRepository(aggregateRootType); if (aggregateRepository != null) { return(await aggregateRepository.GetAsync(aggregateRootId).ConfigureAwait(false)); } return(null); }
public IAggregateRoot RestoreFromSnapshot(Type aggregateRootType, string aggregateRootId) { var aggregateRepository = _aggregateRepositoryProvider.GetRepository(aggregateRootType); if (aggregateRepository != null) { return(aggregateRepository.Get(aggregateRootId)); } return(null); }