Exemplo n.º 1
0
 public void WokeUpBy(DemoEvent2 @event)
 {
     Logger.Info("[DemoSaga] woke up by 'DemoEvent2'");
     // load the state or create a new one if empty
     State = Repository.Load(new Dictionary <string, object>()
     {
         { "Id", @event.Id }
     });
     if (State == null)
     {
         State = new DemoSagaState()
         {
             Id = @event.Id
         }
     }
     ;
     // update the saga internal status
     State.Event2Arrived = true;
     // send out any command and
     // mark is as complete if possible
     TakeBusinessDecisionAnComplete();
     // if it's not completed, persist the state
     PersistIfNotCompleted();
     Logger.Info("[DemoSaga] 'DemoEvent2' processing completed");
 }
Exemplo n.º 2
0
 public void Apply(DemoEvent2 @event)
 {
 }