Esempio n. 1
0
 public ActionResult <IEnumerable <Task> > GetOneTask(int projectId, int taskId)
 {
     try
     {
         var tasks = _projectRepository.GetOneTask(projectId, taskId);
         var model = _mapper.Map <TaskModel>(tasks);
         return(Ok(model));
     }
     catch (AppException ex)
     {
         return(NotFound(new { message = ex.Message }));
     }
     catch (NotFoundException ex)
     {
         return(NotFound(new { message = ex.Message }));
     }
     catch (Exception ex)
     {
         return(BadRequest(new { message = ex.Message }));
     }
 }