0
我有一個「嵌套的」實體框架模型結構。這裏是我的模型:如何使用實體框架更改嵌套模型?
class Parent
{
public int ParentId {get;set;}
virtual ICollection<Child> children {get;set;}
}
class Child
{
public int ChildId {get;set;}
public Parent Parent {get;set;}
virtual ICollection<Account> accounts {get;set;}
}
class Account
{
public int AccountId {get;set;}
public Child Child {get;set;}
public string SomeProperty {get;set;}
}
class DbContext
{
public DbSet<Parent> parents {get;set;}
public DbSet<Child> children {get;set;}
public DbSet<Account> accounts {get;set;}
}
如何更改爲屬於某一父以最小的數據庫查詢所有賬戶的Account.SomeProperty?