zoukankan      html  css  js  c++  java
  • LINQ 嵌套查询

    直接代码:

    //获取教材下的章跟篇
                IList<Chapter> chapters =
                    EntAppFrameWorkContext.DomainModelService.ExtenedService<IEbookManage>()
                        .SearchChapterAndPartByEbookId(ebook.Key);
    
                Dictionary<Chapter,IList<KeyToChaSec>> dictionary=new Dictionary<Chapter, IList<KeyToChaSec>>();
                //根据章跟篇获取可用的知识点目录关系
                foreach (var chapter in chapters)
                {
                    IList<KeyToChaSec> keyToChaSecs =
                        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.KeyPoint.Key,
                                    KnowledgePointRef =
                                        @"xhtml/" + keyToChaSec.ChpSect.PositionPage.Key + ".xhtml#kp" + keyToChaSec.KeyPoint.Key,
                                    ChapterName = keyToChaSec.ChpSect.Name,
                                    ChapterID = keyToChaSec.ChpSect.Key,
                                    KnowledgePoint = keyToChaSec.KeyPoint.Name
                                })
                            };
    

      

  • 相关阅读:
    @SneakyThrows
    docker部署elasticsearch
    docker部署rabbitmq
    docker部署minio
    docker 部署 jenkins
    linux 根据文件名全局查找位置
    docker 容器与宿主机之间文件拷贝
    excel 查看当前单元格是否存在某一列
    机器学习sklearn
    一些博客链接
  • 原文地址:https://www.cnblogs.com/ddddai/p/4325470.html
Copyright © 2011-2022 走看看