Created
October 4, 2025 09:16
-
-
Save wullemsb/1abae07d22aeab822fbde358ea2efa3b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var orders = await context.Orders | |
| .AsNoTrackingWithIdentityResolution() | |
| .Include(o => o.Customer) | |
| .Where(o => o.OrderDate > DateTime.Now.AddDays(-30)) | |
| .ToListAsync(); | |
| // Now all orders that belong to the same customer | |
| // reference the same Customer instance in memory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment