Example #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);
 }
Example #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();
        }
Example #3
0
 public void Apply(TestAggregateDidSomething e)
 {
     DidSomethingCount++;
     DidSomething = true;
 }
 private void Apply(TestAggregateDidSomething e)
 {
     Loaded = true;
     Number++;
 }