如何在Entity Framework中包含Include()子实体导航属性

时间:2013-01-21 09:52:25

标签: c# linq entity-framework

我有一些实体 比如

public class SalesOrderEntity
{
   public virtual ICollection<SalesOrderLineEntity> SalesOrderLineEntities { get; set; }
   ...
}
public class SalesOrderLineEntity
{
   public virtual SOCustomerEntity SOCustomerEntity { get; set; }
   ...
}
public class AirlineTicketEntity : SalesOrderLineEntity
{
   public virtual ICollection<FlightSailEntity> FlightSailEntities { get; set; }
   ...
}

我可以用这种方式预加载其他实体

        return _context.SalesOrderEntities
            .Include("SalesOrderLineEntities")
            .Include("SalesOrderLineEntities.SOCustomerEntity")

但是如何在AirlineTicketEntity中预加载“FlightSailEntity”

0 个答案:

没有答案