You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our team just wasted several hours today debugging "why on earth our nested expands were not applying". After a multitude of different useless attempts, we finally stumbled upon these:
Turns out expands only "work properly" (whatever that means...) if each entity in the expansion chain either has its own entityset, or is marked as [Contained] in the parent.
After adding all of the intermediate entities in the expansion path as entity sets in the EDM, it started working.
As a consumer, I have to say that this is one of the most unintuitive behaviors in AspNetCore OData and is something that is extremely frustrating... The rule doesn't even make sense to me.... "it works, but only sometimes..." expansion levels are ignored arbitrarily based on random characteristics of the referenced entity... they are marked as "entities" and are "navigation properties" already in the metadata... why would they require more than that for deep expansion?!
It would be in the best interest of everybody if this was redesigned somehow IMHO.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Our team just wasted several hours today debugging "why on earth our nested expands were not applying". After a multitude of different useless attempts, we finally stumbled upon these:
Turns out expands only "work properly" (whatever that means...) if each entity in the expansion chain either has its own entityset, or is marked as
[Contained]
in the parent.After adding all of the intermediate entities in the expansion path as entity sets in the EDM, it started working.
As a consumer, I have to say that this is one of the most unintuitive behaviors in AspNetCore OData and is something that is extremely frustrating... The rule doesn't even make sense to me.... "it works, but only sometimes..." expansion levels are ignored arbitrarily based on random characteristics of the referenced entity... they are marked as "entities" and are "navigation properties" already in the metadata... why would they require more than that for deep expansion?!
It would be in the best interest of everybody if this was redesigned somehow IMHO.
Beta Was this translation helpful? Give feedback.
All reactions