// DELETE: api/StudentApi/5 public IHttpActionResult Delete(int id) { StudentDto sd = new StudentDto(); if (sd.GetStudent().Find(student => student.Id == id) == null) { return(BadRequest("Not found")); } else { if (sd.DeleteStudent(id)) { return(Ok()); } } return(BadRequest()); }