protected async Task <TAggregate> TryFindAsync(Guid streamId) { var eventData = await _dbContext.Events .Where(e => e.StreamId.Equals(streamId)) .OrderBy(e => e.Created) .ThenBy(e => e.CommitSequence) .ToListAsync(); var events = eventData .Select(d => _serializer.DeserializeObject <IAggregateEvent>(d.Json)) .ToList(); return(events.Any() ? _aggregateFactory.Create <TAggregate>(events) : null); }