public Course GetCourse(int id) { ILearningRepository repository = new LearningRepository(new LearningContext()); var course = repository.GetCourse(id, false); return(course); }
public IHttpActionResult GetCourse(int courseId) { var course = LearningRepository.GetCourse(courseId); if (course == null) { return(NotFound()); } return(Ok(new { course.Id, course.Name })); }