dotnet / dotnet/efcore

Json/Query: allow backtracking into parent json entities

Open
#28,645 0 comments 0 reactions 0 assignees View on GitHub
area-json
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

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.OwnedReference.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.OwnedReference.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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.