public async Task <AssignmentResponseDto> UpdateAssignment(UpdateAssignmentRequestDto updateAssignmentRequestDto, string guid, string projectGuid) { var assignment = await _assignmentRepository.FindAssignmentById(Utils.checkGuidFormat(guid)); if (assignment != null) { _mapper.Map(updateAssignmentRequestDto, assignment); if (await _assignmentRepository.SaveAll()) { return(_mapper.Map <AssignmentResponseDto>(assignment)); } else { _logger.LogError("Something went wront while trying to update assignment ..."); throw new UnknownException("Something went wront while trying to update assignment.", DomainConsts.APPLICATION_NAME); } } throw new EntityNotFoundException($"{DomainConsts.ENTITY_ASSIGNMENT} with id: {guid} not found.", DomainConsts.APPLICATION_NAME); }
public async Task <IActionResult> UpdateAssignmentById(UpdateAssignmentRequestDto updateAssignmentRequestDto, string assignmentId, string projectId) { return(Ok(await _assignmentService.UpdateAssignment(updateAssignmentRequestDto, assignmentId, projectId))); }