コード例 #1
0
        public ActionResult WithoutChain()
        {
            var parentCourseTCs = CourseChainService.GetAll().Select(x => x.Course_TC)
                                  .Distinct().ToList();

            return(CourseTable("Курсы без цепочек", c =>
                               !parentCourseTCs.Contains(c.ParentCourse_TC)));
        }
コード例 #2
0
        public List <string> GetNextCourseTCs(List <string> parentCourseTCs)
        {
            var nextCourseTCList = CourseChainService.GetAll()
                                   .Where(cc => parentCourseTCs.Contains(cc.Course_TC))
                                   .OrderBy(cc => cc.SortOrder)
                                   .Select(cc => new { cc.NextCourse_TC, cc.SortOrder })
                                   .ToList().Distinct(x => x.NextCourse_TC)
                                   .OrderBy(x => x.SortOrder).Select(x => x.NextCourse_TC).ToList();

            return(nextCourseTCList);
        }