Virtual keyword in EF Core: .NET 10, ILazyLoader and explicit loading samples - #2266
Open
vladimir-pecanac-main wants to merge 2 commits into
Conversation
… samples Retarget both projects to net10.0 and EF Core 10.0.12, bump the test packages, remove the two dead null checks after First(), fix the three nullable warnings, and add an ILazyLoader entity (no virtual members) plus an explicit loading call, each covered by a new test.
…ading Restore the original if (authorLazy is not null) block and the ?. uses so the article's debugger screenshot matches lines 36 to 57 of Program.cs again.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sample update for the article "Why EF Core Lazy Loading Needs Virtual Navigation Properties" (https://code-maze.com/efcore-why-do-we-use-the-virtual-keyword-for-class-properties/).
Folder: dotnet-efcore/VirtualKeywordInEFCore only.
Local run: SDK 10.0.302, runtime 10.0.10. Build 1 warning (CS8602, pre-existing), 0 errors. dotnet test: Passed 5, Failed 0. No vulnerable packages (direct or transitive).