LinqToQuerystring icon indicating copy to clipboard operation
LinqToQuerystring copied to clipboard

Expand does not work for deep includes

Open rogerfar opened this issue 11 years ago • 2 comments

I have an OData query like this:

http://localhost:41084/odata/Appointments?$expand=Person,Person/Address

This will give the following exception:

A specified Include path is not valid. The EntityType 'Site.Data.Appointment' does not declare a navigation property with the name 'Address'.

Which is correct because Appointment does not have a property Address, Person does, so it doesn't work very well with the deep includes.

rogerfar avatar Jul 04 '14 16:07 rogerfar

Hi @rogier21, expand in Linq to Querystring does not work in exactly the same way as described in the OData specification. Behind the scenes expand is mapped directly to the Include method and currently we don't support nested properties here.

That said, I will try to take a look when I have some time over the next few weeks to see if it is possible to extend this for you.

beyond-code-github avatar Jul 10 '14 21:07 beyond-code-github

Thanks! I think deep includes would be a nice to have anyway, even if it's not for the OData spec.

rogerfar avatar Jul 10 '14 21:07 rogerfar