Push queries on lazy navigation properties to database (a.k.a extra lazy loading)

Open
#1,204 9 comments 31 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp

Research direction

Start with the linked gist and AccountingModel/src/AccountingModel/Model/Account.cs, especially the Transactions collection and its constrained access. No EF Core source file or test is named; the work is complete when constrained queries on the lazy navigation are pushed to the database instead of loading all transactions.

Written by the indexing model from the issue text.

Description

area-change-tracking area-o/c-mapping area-query

Hi Team,

I am a former NHibernate user that is switching over to using Entity Framework. I wanted to share with you a scenario that surprised me when I first encountered it. You can see my write up and sample code here. The full source of the project is located here.

TLDR: My Account entity has a Transactions collection. Attempting to pull data out of the transactions collection loads all the transactions from the database, even though I have constrained all transaction access in the model to limit the number of them coming back.

You all may not even be focus on this right now, but it's a use case that is needed. Keep it in your back pocket. 👍

Dominant language
C#
Stars
14.8k
Forks
3.4k
Avg merge
2d 5h
Merged PRs (30d)
134

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/efcore

All issues in dotnet/efcore

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.