private void Handle(GoodsUpdatedEvent evnt) { var editableInfo = evnt.Info; _info = new GoodsInfo( editableInfo.Name, editableInfo.Description, editableInfo.Pics, editableInfo.Price, _info.OriginalPrice, editableInfo.Benevolence, _info.Stock, editableInfo.SellOut, _info.IsPayOnDelivery, _info.IsInvoice, _info.Is7SalesReturn, _info.Sort); }
public Task <AsyncTaskResult> HandleAsync(GoodsUpdatedEvent evnt) { return(TryTransactionAsync(async(connection, transaction) => { var info = evnt.Info; var effectedRows = await connection.UpdateAsync(new { Name = info.Name, Description = info.Description, Pics = info.Pics.ExpandAndToString("|"), Price = info.Price, Benevolence = info.Benevolence, SellOut = info.SellOut, Status = (int)info.Status, RefusedReason = info.RefusedReason, Version = evnt.Version, EventSequence = evnt.Sequence }, new { Id = evnt.AggregateRootId, //Version = evnt.Version - 1 }, ConfigSettings.GoodsTable, transaction); })); }