private T GetFromFullStreamOfEvents(Guid id, IEventStoreDbContext context) { // if memento not found then try get full stream var streamOfEvents = context.Events .Where(e => e.StreamId == id && e.StreamType == this.streamType) .OrderBy(e => e.Version) .AsEnumerable() .Select(e => this.serializer.Deserialize <IEvent>(e.Payload)) .AsCachedAnyEnumerable(); if (streamOfEvents.Any()) { return(this.aggregateFactory.Invoke(id, streamOfEvents)); } return(null); }
public EventLoggerBehavior(IEventStoreDbContext eventStoreDbContext) { _eventStoreDbContext = eventStoreDbContext; }
private bool IsDuplicate(Guid eventId, IEventStoreDbContext context) => context.Inbox.Any(e => e.EventId == eventId);
public EventStore(IEventStoreDbContext context, IDateTime dateTime) { _dateTime = dateTime; _context = context; }
public AggregateSet(IEventStoreDbContext context, IDateTime dateTime) { _context = context; _dateTime = dateTime; }
public CreateCustomerCommandHandler(IEventStoreDbContext eventStoreDbContext) { _eventStoreDbContext = eventStoreDbContext; }
public void UpdateReadModel(IEventStoreDbContext context) { this.denormalize((TDbContext)context); }
public EventStore(IEventStoreDbContext context, IDateTime dateTime, ICorrelationIdAccessor correlationIdAccessor) { _dateTime = dateTime; _context = context; _correlationIdAccessor = correlationIdAccessor; }