Beispiel #1
0
 public Task <AsyncTaskResult> HandleAsync(NewOperatRecordEvent evnt)
 {
     return(TryTransactionAsync(async(connection, transaction) =>
     {
         //尽管是更新ExpressAddresssTable但是也要更新聚合跟,因为地址属于聚合跟的状态
         var effectedRows = await connection.UpdateAsync(new
         {
             Version = evnt.Version,
             EventSequence = evnt.Sequence
         }, new
         {
             Id = evnt.AggregateRootId,
             //Version = evnt.Version - 1
         }, ConfigSettings.AdminTable, transaction);
         if (effectedRows == 1)
         {
             await connection.InsertAsync(new
             {
                 Id = GuidUtil.NewSequentialId(),
                 AdminId = evnt.AggregateRootId,
                 AboutId = evnt.Info.AboutId,
                 AdminName = evnt.Info.AdminName,
                 Operat = evnt.Info.Operat,
                 Remark = evnt.Info.Remark,
                 CreatedOn = evnt.Timestamp
             }, ConfigSettings.AdminOperatRecordTable, transaction);
         }
     }));
 }
Beispiel #2
0
 private void Handle(NewOperatRecordEvent evnt)
 {
 }