Ejemplo n.º 1
0
 public InMemoryEventStoreETagChecker(InMemoryEventStream eventStream)
 {
     if (eventStream == null)
     {
         throw new ArgumentNullException(nameof(eventStream));
     }
     this.eventStream = eventStream;
 }
 public InMemoryEventStoreETagChecker(InMemoryEventStream eventStream)
 {
     if (eventStream == null)
     {
         throw new ArgumentNullException("eventStream");
     }
     this.eventStream = eventStream;
 }
 public InMemoryCommandPreconditionVerifier(InMemoryEventStream eventStream)
 {
     if (eventStream == null)
     {
         throw new ArgumentNullException("eventStream");
     }
     this.eventStream = eventStream;
 }
Ejemplo n.º 4
0
        public InMemoryEventStoreDbContext(InMemoryEventStream eventStream = null)
        {
            this.eventStream = eventStream ?? new InMemoryEventStream();
            eventStream      = eventStream ?? Domain.Configuration
                               .Current
                               .Container
                               .Resolve <InMemoryEventStream>();

            sqlEvents = new InMemoryDbSet <StorableEvent>(new HashSet <StorableEvent>(eventStream.Events.Select(e => e.ToStorableEvent())));
        }
Ejemplo n.º 5
0
        internal static IEventStream ToEventStream(this IEnumerable <IEvent> events, string name)
        {
            var stream = new InMemoryEventStream(name);

            var storableEvents = events.AssignSequenceNumbers()
                                 .Select(e => e.ToStoredEvent());

            stream.Append(storableEvents.ToArray())
            .Wait();

            return(stream);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="InMemoryEventSourcedRepository{TAggregate}"/> class.
 /// </summary>
 public InMemoryEventSourcedRepository(InMemoryEventStream eventStream = null, IEventBus bus = null)
 {
     this.eventStream = eventStream ?? new InMemoryEventStream(AggregateType <TAggregate> .EventStreamName);
     this.bus         = bus ?? new FakeEventBus();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InMemoryEventSourcedRepository{TAggregate}"/> class.
 /// </summary>
 public InMemoryEventSourcedRepository(InMemoryEventStream eventStream = null, IEventBus bus = null)
 {
     this.eventStream = eventStream ?? new InMemoryEventStream();
     this.bus         = bus ?? new FakeEventBus();
 }