public IHttpActionResult deleteProject([FromUri] int projectID) { if (!ModelState.IsValid) { return(BadRequest("Not a valid data")); } try { TaskManagerRepository tmRep = new TaskManagerRepository(); if (projectID > 0) { if (tmRep.getUserFromProjectID(projectID) != null) { return(BadRequest("Could not delete Project having User mapped")); } else { tmRep.deleteProject(projectID); return(Ok()); } } else { return(BadRequest("Error occurred during data deletion in deleteProject")); } } catch (Exception ex) { return(BadRequest("Error occurred in DeleteTask :" + ex.StackTrace)); } }