How do you construct a LINQ to Entities query to load child objects directly, instead of calling a Reference property or Load()

后端 未结 3 507
面向向阳花
面向向阳花 2020-12-02 14:22

I\'m new to using LINQ to Entities (or Entity Framework whatever they\'re calling it) and I\'m writing a lot of code like this:

var item = (from InventoryIte         


        
3条回答
  •  难免孤独
    2020-12-02 14:49

    In addition to Robert's answer, you might like to check out this question for options for an extension method that that allows you to .Include() using an expression instead of a string, so you get compile time checking:

    Entity Framework .Include() with compile time checking?

提交回复
热议问题