public ActionResult WithoutChain() { var parentCourseTCs = CourseChainService.GetAll().Select(x => x.Course_TC) .Distinct().ToList(); return(CourseTable("Курсы без цепочек", c => !parentCourseTCs.Contains(c.ParentCourse_TC))); }
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); }