Exemple #1
0
        public List <CourseModel> MostExpensiveCourse()
        {
            List <CourseModel> mostExpCourses = new List <CourseModel>();

            CourseDAO     course     = new CourseDAO();
            List <Course> coursesExp = course.MostExpensive();

            foreach (Course courseExp in coursesExp)
            {
                CourseModel newCourse = new CourseModel();
                newCourse.Id   = courseExp.Id;
                newCourse.Name = courseExp.Name;
                newCourse.Cost = courseExp.CourseCost;
                mostExpCourses.Add(newCourse);
            }

            return(mostExpCourses);
        }