dotnet / dotnet/EntityFramework.Docs

private iLazyLoader in sample code doesn't work as described

Open
#4,992 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Mermaid
Stars
1.7k
Forks
2k
Avg merge
7d 23h
Merged PRs (30d)
16

Description

### Type of issue

Code doesn't work

### Description

The documentation says that for objects created with the 'new' keyword, EF will populate the LazyLoader when the entity gets attached to the context. However, all the examples show that LazyLoader property being private and it will only populate if that property is public. The same is true for entities created from a query when the constructor that takes a LazyLoader is private

[Enter feedback here]

### Page URL

https://learn.microsoft.com/en-us/ef/core/querying/related-data/lazy

### Content source URL

https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/querying/related-data/lazy.md

### Document Version Independent Id

7c665098-afcc-1ba0-d6a2-0262ae921575

### Article author

@roji

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.