Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public EventLoggerBehavior(IEventStoreDbContext eventStoreDbContext)
 {
     _eventStoreDbContext = eventStoreDbContext;
 }
Exemplo n.º 3
0
 private bool IsDuplicate(Guid eventId, IEventStoreDbContext context)
 => context.Inbox.Any(e => e.EventId == eventId);
Exemplo n.º 4
0
 public EventStore(IEventStoreDbContext context, IDateTime dateTime)
 {
     _dateTime = dateTime;
     _context  = context;
 }
Exemplo n.º 5
0
 public AggregateSet(IEventStoreDbContext context, IDateTime dateTime)
 {
     _context  = context;
     _dateTime = dateTime;
 }
Exemplo n.º 6
0
 public CreateCustomerCommandHandler(IEventStoreDbContext eventStoreDbContext)
 {
     _eventStoreDbContext = eventStoreDbContext;
 }
Exemplo n.º 7
0
 public void UpdateReadModel(IEventStoreDbContext context)
 {
     this.denormalize((TDbContext)context);
 }
Exemplo n.º 8
0
 public EventStore(IEventStoreDbContext context, IDateTime dateTime, ICorrelationIdAccessor correlationIdAccessor)
 {
     _dateTime = dateTime;
     _context  = context;
     _correlationIdAccessor = correlationIdAccessor;
 }