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