public async Task <ActionResult <ProductStatusDetail_ProductStatusDTO> > Update([FromBody] ProductStatusDetail_ProductStatusDTO ProductStatusDetail_ProductStatusDTO) { if (!ModelState.IsValid) { throw new MessageException(ModelState); } ProductStatus ProductStatus = ConvertDTOToEntity(ProductStatusDetail_ProductStatusDTO); ProductStatus = await ProductStatusService.Update(ProductStatus); ProductStatusDetail_ProductStatusDTO = new ProductStatusDetail_ProductStatusDTO(ProductStatus); if (ProductStatus.IsValidated) { return(ProductStatusDetail_ProductStatusDTO); } else { return(BadRequest(ProductStatusDetail_ProductStatusDTO)); } }
public async Task <ActionResult <bool> > Update(UpdateProductStatusModel request) { return(Ok(await _productStatusService.Update(await GetUserId(), request, GetPermissionId()))); }