public Task <AsyncTaskResult> HandleAsync(UserGiftPayedEvent evnt) { return(TryTransactionAsync(async(connection, transaction) => { var effectedRows = await connection.UpdateAsync(new { Version = evnt.Version, EventSequence = evnt.Sequence }, new { Id = evnt.AggregateRootId, //Version = evnt.Version - 1 }, ConfigSettings.UserTable, transaction); if (effectedRows == 1) { await connection.UpdateAsync(new { Remark = "未发货" }, new { UserId = evnt.AggregateRootId, Id = evnt.UserGiftId }, ConfigSettings.UserGiftTable, transaction); } })); }
/// <summary> /// 传递大使 付款成功 /// </summary> /// <param name="message"></param> /// <returns></returns> public Task <AsyncTaskResult> HandleAsync(UserGiftPayedEvent evnt) { return(_commandService.SendAsync( new PayToAmbassadorCommand { AggregateRootId = evnt.AggregateRootId })); }
private void Handle(UserGiftPayedEvent evnt) { }
private void Handle(UserGiftPayedEvent evnt) { _userGifts.Single(x => x.Id == evnt.UserGiftId).Remark = "未发货"; }