public IHttpActionResult DeleteStudentDetail(int studentId) { using (var database = new StudentDbEntities()) { Student stud = new Student(); stud = student.Students.Find(studentId); if (stud == null) { return(NotFound()); } var delete = database.spDelete(studentId); database.SaveChanges(); } return(Ok(student)); }