Ejemplo n.º 1
0
        public void Handle(TestAggregateDidSomethingElse2 message)
        {
            TestSaga saga = GetSaga(message.Id);

            saga.Handle(message);
            SagaUnitOfWork.Add(saga);
            SagaUnitOfWork.Commit();
        }
Ejemplo 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();
        }