public async Task <ApiResponse> UpdateServiceCategory(long id, ServiceCategoryReceivingDTO serviceCategoryReceivingDTO) { var serviceCategoryToUpdate = await _serviceCategoryRepo.FindServiceCategoryById(id); if (serviceCategoryToUpdate == null) { return(new ApiResponse(404)); } serviceCategoryToUpdate.Name = serviceCategoryReceivingDTO.Name; serviceCategoryToUpdate.Description = serviceCategoryReceivingDTO.Description; serviceCategoryToUpdate.ServiceGroupId = serviceCategoryReceivingDTO.ServiceGroupId; serviceCategoryToUpdate.DivisionId = serviceCategoryReceivingDTO.DivisionId; serviceCategoryToUpdate.OperatingEntityId = serviceCategoryReceivingDTO.OperatingEntityId; var updatedServiceCategory = await _serviceCategoryRepo.UpdateServiceCategory(serviceCategoryToUpdate); if (updatedServiceCategory == null) { return(new ApiResponse(500)); } var serviceCategoryTransferDTO = _mapper.Map <ServiceCategoryTransferDTO>(updatedServiceCategory); return(new ApiOkResponse(serviceCategoryTransferDTO)); }