Beispiel #1
0
        public List <CourseModel> MostCheapestCourse()
        {
            List <CourseModel> mostExpCourses = new List <CourseModel>();

            CourseDAO     course       = new CourseDAO();
            List <Course> coursesCheap = course.MostCheapest();

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

            return(mostExpCourses);
        }