public HttpResponseMessage Get(int id) { Instructor instructor = _instructorService.GetInstructorById(id); if (instructor == null) { return(Request.CreateResponse(HttpStatusCode.NotFound, "Instructor not found")); } return(Request.CreateResponse(HttpStatusCode.OK, instructor)); }
public HttpResponseMessage GetInstructorById(int id) { if (id < 0) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } else { var Instructor = _Instructorservice.GetInstructorById(id); if (Instructor != null) { return(Request.CreateResponse(HttpStatusCode.OK, Instructor)); } else { return(Request.CreateResponse(HttpStatusCode.NotFound, "No Instructor for id " + id)); } } }
public ActionResult Update(int InstructorId) { var instructor = _service.GetInstructorById(InstructorId); return(View(instructor)); }