public async Task UpdateAsync(Product product) { var command = new ProductChangeCommand(product.ProductId, product.ProductName, product.CategoryId, product.UnitPrice, product.UnitsInStock, product.PictureUrl ); await eventBus.SendCommand(command); }
public async Task <ICommandResult> Handle(ProductChangeCommand mesage) { try { ICommandResult result = new CommandResult() { Message = "", //ObjectId = banner.Id, Status = CommandResult.StatusEnum.Sucess }; return(result); } catch (Exception e) { e.Data["Param"] = mesage; ICommandResult result = new CommandResult() { Message = e.Message, Status = CommandResult.StatusEnum.Fail }; return(result); } }