public async Task <AssignmentResponse> GetByIdAsync(int id)
        {
            var existingAssignment = await _assignmentRepository.FindById(id);

            if (existingAssignment == null)
            {
                return(new AssignmentResponse("Assignment not found"));
            }
            return(new AssignmentResponse(existingAssignment));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> FindById([FromRoute] Guid id)
        {
            var result = await _repository.FindById(id);

            if (result == null)
            {
                return(NotFound());
            }

            var response = _mapper.Map <AssignmentDto>(result);

            return(Ok(response));
        }
 public Assignment FindById(Guid id)
 {
     return(_assignmentRepository.FindById(id));
 }