/// <summary> /// Maps <paramref name="addAssignmentDTO"/> to <c><b>Assignment</b></c> object and adds that product to repository. /// </summary> /// <param name="addAssignmentDTO">Assignment to be added.</param> /// <returns></returns> public async Task AddAssignmentAsync(AddAssignmentDTO addAssignmentDTO) { var assignment = new Assignment { Title = addAssignmentDTO.Title, Description = addAssignmentDTO.Description, RemarksToStudent = addAssignmentDTO.RemarksToStudent, RemarksToMentor = addAssignmentDTO.RemarksToMentor, Level = addAssignmentDTO.Level, Rules = addAssignmentDTO.Rules, MaxDeliveryDay = addAssignmentDTO.MaxDeliveryDay, ProfessionId = addAssignmentDTO.ProfessionId, }; await _assignmentRepository.AddAsync(assignment).ConfigureAwait(false); }
public async Task<IActionResult> AddAssignment([FromBody] AddAssignmentDTO addAssignment) { return await _assigmentService.AddAssignmentAsync(addAssignment).ConfigureAwait(false).GetObjectResponseAsync<AddAssignmentDTO>("Success").ConfigureAwait(false); }