public async Task <ICommandResult> Handle(ProductGroupChangeCommand message) { try { ICommandResult result; RProductGroup rproductGroup = await _productGroupService.Get(message.Id); if (rproductGroup == null) { result = new CommandResult() { Message = "ProductGroup not found", ObjectId = "", Status = CommandResult.StatusEnum.Fail, ResourceName = ResourceKey.ProductGroup_NotFound }; return(result); } ProductGroup productGroup = new ProductGroup(rproductGroup); productGroup.Change(message); await _productGroupService.Change(productGroup); result = new CommandResult() { Message = "", ObjectId = productGroup.Id, Status = CommandResult.StatusEnum.Sucess }; return(result); } catch (Exception e) { e.Data["Param"] = message; ICommandResult result = new CommandResult() { Message = e.Message, Status = CommandResult.StatusEnum.Fail }; return(result); } }