Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic eager loading of owned types #8843

Closed
divega opened this issue Jun 13, 2017 · 1 comment
Closed

Automatic eager loading of owned types #8843

divega opened this issue Jun 13, 2017 · 1 comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@divega
Copy link
Contributor

divega commented Jun 13, 2017

(previously tracked as part of #2953)

Owned types currently don't get eager loaded automatically, i.e. you need to use Include() like with any other entity type. Early on we said we wanted the Include() call to be unnecessary and we devised that we would create an annotation in the model that marked navigation properties as "always include" and a convention would annotate the navigations to owned types as such automatically. The annotation would provide a way to opt out, and we could create fluent API for it.

We are closer to be done with 2.0 and we believe the full design does not fit, but there can be smaller versions of it that do.

One of the main problems with not doing this by default is the kind of queries users need to write in order for navigations which are defined in derived types to be included. There is currently no API for Include() that works with navigations defined in derived types, hence you have to split your query, e.g.:

var ds =context.Ds.Where(predicate);
var derived = ds.OfType<D1>().Include(d1=>d1.NavA).Concat(ds.OfType<D2>().Include(d2=>d2.NavB)).Concat();

Also, Concat() is evaluated in memory.

@ajcvickers
Copy link
Contributor

I won't be in triage tomorrow (if you guys still do it) but I'm good in principle with doing just the non-API work and the convention.

@divega divega added this to the 2.0.0 milestone Jun 15, 2017
anpete added a commit that referenced this issue Jun 20, 2017
- Adds INavigation.IsEager - navs can now be marked as eager by-default (core metadata only).
- Adds a core convention that sets IsEager=true for principal-to-dependent navs when FK.IsOwnership=true.
- Updates the query compiler to auto-synthesize Include trees for owned navs on result QSREs.
- Adds a new query test suite for testing queries involving ownership.
anpete added a commit that referenced this issue Jun 20, 2017
- Adds INavigation.IsEager - navs can now be marked as eager by-default (core metadata only).
- Adds a core convention that sets IsEager=true for principal-to-dependent navs when FK.IsOwnership=true.
- Updates the query compiler to auto-synthesize Include trees for owned navs on result QSREs.
- Adds a new query test suite for testing queries involving ownership.
anpete added a commit that referenced this issue Jun 20, 2017
- Adds INavigation.IsEager - navs can now be marked as eager by-default (core metadata only).
- Adds a core convention that sets IsEager=true for principal-to-dependent navs when FK.IsOwnership=true.
- Updates the query compiler to auto-synthesize Include trees for owned navs on result QSREs.
- Adds a new query test suite for testing queries involving ownership.
anpete added a commit that referenced this issue Jun 20, 2017
- Adds INavigation.IsEager - navs can now be marked as eager by-default (core metadata only).
- Adds a core convention that sets IsEager=true for principal-to-dependent navs when FK.IsOwnership=true.
- Updates the query compiler to auto-synthesize Include trees for owned navs on result QSREs.
- Adds a new query test suite for testing queries involving ownership.
anpete added a commit that referenced this issue Jun 20, 2017
- Adds INavigation.IsEager - navs can now be marked as eager by-default (core metadata only).
- Adds a core convention that sets IsEager=true for principal-to-dependent navs when FK.IsOwnership=true.
- Updates the query compiler to auto-synthesize Include trees for owned navs on result QSREs.
- Adds a new query test suite for testing queries involving ownership.
anpete added a commit that referenced this issue Jun 20, 2017
- Adds INavigation.IsEager - navs can now be marked as eager by-default (core metadata only).
- Adds a core convention that sets IsEager=true for principal-to-dependent navs when FK.IsOwnership=true.
- Updates the query compiler to auto-synthesize Include trees for owned navs on result QSREs.
- Adds a new query test suite for testing queries involving ownership.
anpete added a commit that referenced this issue Jun 20, 2017
- Adds INavigation.IsEager - navs can now be marked as eager by-default (core metadata only).
- Adds a core convention that sets IsEager=true for principal-to-dependent navs when FK.IsOwnership=true.
- Updates the query compiler to auto-synthesize Include trees for owned navs on result QSREs.
- Adds a new query test suite for testing queries involving ownership.
@anpete anpete closed this as completed in 80e5dee Jun 20, 2017
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

No branches or pull requests

3 participants