我正在使用Entity Framework 5 code first和ASP.NET MVC 3.
我正在努力让一个子对象的子对象填充.以下是我的课程..
申请类;
public class Application
{
// Partial list of properties
public virtual ICollection<Child> Children { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
儿童班:
public class Child
{
// Partial list of properties
public int ChildRelationshipTypeId { get; set; }
public virtual ChildRelationshipType ChildRelationshipType { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
ChildRelationshipType类:
public class ChildRelationshipType
{
public int Id { get; set; }
public string Name { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
存储库中GetAll方法的一部分,用于返回所有应用程序:
return DatabaseContext.Applications …Run Code Online (Sandbox Code Playgroud) entity-framework entity-framework-4 entity-framework-4.1 entity-framework-5