Exemplo n.º 1
0
 public void Handle(TestAggregateDidSomething message)
 {
     // This could happen out of order in this test
     if (DidSomethingElse2)
     {
         CommandPublisher.Publish(new TestAggregateDoSomething3());
         // This is a testing variable
         Responded = true;
     }
     ApplyChange(message);
 }
Exemplo n.º 2
0
        public void Handle(TestAggregateDidSomething message)
        {
            // There are two ways for this to pan out.
            // 1) Events WILL arrive in order in which case this handler would ADD TO and all others would GET FROM the UOW
            // 2) Events may not arrive in order in which case all handlers should try to GET FROM and if it fails ADD TO the UOW
            // Given this is a test, we'll code for the first.

            var saga = new TestSaga(DependencyResolver, message.Id == Guid.Empty ? Guid.NewGuid() : message.Id);

            saga.Handle(message);
            SagaUnitOfWork.Add(saga);
            SagaUnitOfWork.Commit();
        }
Exemplo n.º 3
0
 public void Apply(TestAggregateDidSomething e)
 {
     DidSomethingCount++;
     DidSomething = true;
 }
Exemplo n.º 4
0
 private void Apply(TestAggregateDidSomething e)
 {
     Loaded = true;
     Number++;
 }