Exemple #1
0
 public void WokeUpBy(DemoEvent1 @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.Event1Arrived = 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] 'DemoEvent1' processing completed");
 }
Exemple #2
0
 public void Apply(DemoEvent1 @event)
 {
 }