public List <CourseModel> AllCourses() { List <CourseModel> listCourses = new List <CourseModel>(); CourseDAO course = new CourseDAO(); List <Course> allCourses = course.GetAllByOrder(); foreach (Course cour in allCourses) { CourseModel newCourse = new CourseModel(); newCourse.Id = cour.Id; newCourse.Name = cour.Name; newCourse.Cost = cour.CourseCost; listCourses.Add(newCourse); } return(listCourses); }