开发者

How to "Expand" a property using LinqPad and Entity Framework

开发者 https://www.devze.com 2023-04-12 02:02 出处:网络
I have an entity set (lets call it Clients) that I am querying using LinqPad. It is accessing the data via Entity Framework.I am able to connect just fine and see most of my data.

I have an entity set (lets call it Clients) that I am querying using LinqPad.

It is accessing the data via Entity Framework. I am able to connect just fine and see most of my data.

However, Clients has a property called Location. Location contains several properties by itself (State, City, Zip).

When I return all the Clients, the rows with no location show null. But th开发者_如何学编程e rows that have a location just have an empty square. (It is missing the box that has the data for the matching row of Location that is in the database.)

I know that my data is there and good. (I am able to query it just fine using OData: Clients.Expand("Location").

How can I do an "Expand" (or what ever is needed) to get to see the other associations/navigation properties in my result set?


I haven't tested it in LinQPad, but would try using Include: Clients.Include("Location")

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号