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