public List <Course> Get() { ILearningRepository repository = new LearningRepository(new LearningContext()); return(repository.GetAllCourses().ToList()); }
public IHttpActionResult GetAll() { var courses = LearningRepository.GetAllCourses().Select(x => new { x.Id, x.Name }); return(Ok(courses)); }