示例#1
0
文件: Demo.cs 项目: csuffyy/Prxm.Cqrs
 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");
 }
示例#2
0
文件: Demo.cs 项目: csuffyy/Prxm.Cqrs
 public void Apply(DemoEvent2 @event)
 {
 }