コード例 #1
0
 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);
 }
コード例 #2
0
 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);
     }
 }