public IHttpActionResult GetAllSubjects([FromUri] int ClassID) { try { if (ModelState.IsValid) { return(Content(HttpStatusCode.OK, new DataModel() { HttpStatusCode = System.Net.HttpStatusCode.OK, Exception = null, Data = professorService.GetAllSubjects(ClassID) })); } else { return(BadRequest(ModelState)); } } catch (Exception ex) { return(InternalServerError(ex)); } }