Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/338.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# EF6-获得所有相关儿童_C#_Asp.net Mvc_Linq_Entity Framework 6 - Fatal编程技术网

C# EF6-获得所有相关儿童

C# EF6-获得所有相关儿童,c#,asp.net-mvc,linq,entity-framework-6,C#,Asp.net Mvc,Linq,Entity Framework 6,所以,我们创建了一个采访。它是这样建造的: class interview { public virtual ICollection<WebQuestionPage> WebQuestionPage { get; set; } } 这真的不是那么漂亮、容易阅读或快速,因为即使没有嵌套的子对象,它也会加入 这是使用EF6编写的ASP.NET MVC。纯SQL和递归CTE。这是检索层次结构的最快方法。考虑NoSQL解决方案(如果可以)。 public virtu

所以,我们创建了一个采访。它是这样建造的:

class interview
{
         public virtual ICollection<WebQuestionPage> WebQuestionPage { get; set; }
}
这真的不是那么漂亮、容易阅读或快速,因为即使没有嵌套的子对象,它也会加入


这是使用EF6编写的ASP.NET MVC。

纯SQL和递归CTE。这是检索层次结构的最快方法。考虑NoSQL解决方案(如果可以)。
   public virtual ICollection<WebQuestionSection> WebQuestionSection { get; set; }
        public virtual ICollection<WebQuestionSection> WebQuestionSection1 { get; set; }
        
        public virtual ICollection<WebQuestion> WebQuestion { get; set; }
 interview = _dbWeb.WebInterview.Include("WebQuestionPage")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestionOption")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestionType")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestion1")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestion1.WebQuestionOption")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestion1.WebQuestionType")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestion1.WebQuestion1")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestion1.WebQuestion1.WebQuestionOption")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestion1.WebQuestion1.WebQuestionType")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestion1.WebQuestion1.WebQuestion1")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestionOption")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestionType")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestion1")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestionOption")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestion.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestionType")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestionOption")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestionType")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestion1")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestion1.WebQuestionOption")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestion1.WebQuestionType")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestion1.WebQuestion1")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestion1.WebQuestion1.WebQuestionOption")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestion1.WebQuestion1.WebQuestionType")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestion1.WebQuestion1.WebQuestion1")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestionOption")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestionType")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestion1")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestionOption")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestion.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestion1.WebQuestionType")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestionSection1.WebQuestion")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestionSection1.WebQuestion.WebQuestionOption")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestionSection1.WebQuestion.WebQuestionType")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestionSection1.WebQuestion.WebQuestion1")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestionSection1.WebQuestion.WebQuestion1.WebQuestionOption")
            .Include("WebQuestionPage.WebQuestionSection.WebQuestionSection1.WebQuestionSection1.WebQuestion.WebQuestion1.WebQuestionType")
            
            ... and so on