public async Task <ICommandResult> Handle(ProductGroupAttributeAddCommand message) { try { ICommandResult result; RProductGroup rproductGroup = await _productGroupService.Get(message.ProductGroupId); 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.AddAttribute(message); await _productGroupService.ChangeConditions(productGroup.Id, productGroup.Conditions, productGroup.UpdatedUid, productGroup.UpdatedDateUtc); 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); } }