public IActionResult AddTask(int projectId, Task task) { try { _projectRepository.AddTask(projectId, task); return(Ok()); } catch (NotFoundException ex) { return(NotFound(new { message = ex.Message })); } catch (Exception ex) { return(BadRequest(new { message = ex.Message })); } }