Example #1
0
 public ActionResult <IEnumerable <Task> > GetTasks(int projectId)
 {
     try
     {
         var tasks = _projectRepository.GetAllTasks(projectId);
         var model = _mapper.Map <IList <TaskModel> >(tasks);
         return(Ok(model));
     }
     catch (NotFoundException ex)
     {
         return(NotFound(new { message = ex.Message }));
     }
     catch (Exception ex)
     {
         return(BadRequest(new { message = ex.Message }));
     }
 }