public Task <AsyncTaskResult> HandleAsync(NewThirdCurrencyImportLogEvent 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.ThirdCurrencyTable, transaction); if (effectedRows == 1) { await connection.InsertAsync(new { Id = GuidUtil.NewSequentialId(), ThirdCurrencyId = evnt.AggregateRootId, WalletId = evnt.LogInfo.WalletId, Mobile = evnt.LogInfo.Mobile, Account = evnt.LogInfo.Account, Amount = evnt.LogInfo.Amount, ShopCashAmount = evnt.LogInfo.ShopCashAmount, Conversion = evnt.LogInfo.Conversion, CreatedOn = evnt.Timestamp }, ConfigSettings.ThirdCurrencyImportLogTable, transaction); } })); }
private void Handle(NewThirdCurrencyImportLogEvent evnt) { _importLogs.Add(evnt.LogInfo); }