public static ProductGroupWarehouseRemoveCommand ToCommandWarehouseRemove(this ProductGroupWarehouseRemoveRequest request, string uid) { if (request == null) { return(null); } return(new ProductGroupWarehouseRemoveCommand() { ProductGroupId = request.ProductGroupId, UpdatedUid = uid, WarehouseId = request.WarehouseId }); }
public async Task <IActionResult> RemoveWarehouse([FromBody] ProductGroupWarehouseRemoveRequest request) { try { BaseResponse response = new BaseResponse(); ValidationResult validate = ProductGroupWarehouseAddRequestValidator.ValidateModel(request); if (validate.IsValid) { response = await _productGroupAppService.RemoveWarehouse(request); } else { response.SetFail(validate.Errors.Select(p => p.ToString())); } return(Json(response)); } catch (Exception e) { _logger.LogError(e, Common.Common.GetMethodName(), request); throw; } }