public IHttpActionResult DeleteTask(int TaskID) { if (!ModelState.IsValid) { return(BadRequest("Not a valid data")); } try { TaskManagerRepository TaskRep = new TaskManagerRepository(); if (TaskID > 0) { TaskRep.DeleteTask(TaskID); return(Ok()); } else { return(BadRequest("Error occurred during data deletion in DeleteTask")); } } catch (Exception ex) { return(BadRequest("Error occurred in DeleteTask :" + ex.StackTrace)); } }