示例#1
0
        public List <Course> GetCourses()
        {
            List <Course> courseList;

            try
            {
                courseList = new CourseRepo().GetCourses();
                if (courseList.Any())
                {
                    return(courseList);
                }
                else
                {
                    throw new PrometheusException("No Courses Found!");
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
        // Can be moved to CourseBL
        // Returns List of Courses
        public List <Course> GetCoursesAsList()
        {
            List <Course> CourseList;

            try
            {
                CourseList = new CourseRepo().GetCourses();
                if (CourseList.Any())
                {
                    return(CourseList);
                }
                else
                {
                    throw new PrometheusException("No Courses Found!");
                }
            }
            catch (Exception ex)
            {
                throw new PrometheusException(ex.Message);
            }
        }