efcore
efcore copied to clipboard
Json/Query: allow backtracking into parent json entities
When json has navigation to the parent entity, it's possible to build linq that would navigate back to the parent, e.g.
entity.Select(x => x.OwnedReferece.OwnedNested.Parent.Name)
currently we throw as there is not much value in supporting this, but we could be smarter about it and "chop off" the unnecessary navs, so the query above would be equivalent to:
entity.Select(x => x.OwnedReferece.Name)
Since we don't have query filters this should be fine. We should only pay attention to nullability (traversing to OwnedNested could render the entire chain nullable, if that navigation was nullable and OwnedReference was required