Direct code:
Get the chapter and article ilist<chapter> chapters = EntAppFrameWorkContext.DomainModelService.ExtenedSer Vice<iebookmanage> (). Searchchapterandpartbyebookid (ebook. Key); Dictionary<chapter,ilist<keytochasec>> dictionary=new Dictionary<chapter, IList<KeyToChaSec> > (); Get the available Knowledge Point directory relationship based on chapter and article foreach (Var chapter in chapters) {ilist<keytochasec> Keyt Ochasecs = entappframeworkcontext.domainmodelservice.extenedservice<iebookmanage> () . Searchallvalidkeytochasecbychapterorpart (chapter. Key); Dictionary. ADD (CHAPTER,KEYTOCHASECS); } var jsons = from dic in dictionary select new { Chapterid=dic. Key.key, Chaptername=dic. Key.name, knowledgepoints= ( From Keytochasec in DIC. Value Select New {ID = KEYTOCHASEC.K Eypoint.key, Knowledgepointref = @ "xhtml/" + keytochasec . ChpSect.PositionPage.Key + ". Xhtml#kp" + keyToChaSec.KeyPoint.Key, Chaptername = Keytochase C.chpsect.name, Chapterid = KeyToChaSec.ChpSect.Key, knowled Gepoint = KeyToChaSec.KeyPoint.Name})};
LINQ nested queries