Closed belav closed 2 months ago
@belav Can you be more specific? I see ILazyLoader
being used in the examples that show its use, and Action<object, string>
in the examples that show its use. Everything seems correct.
@ajcvickers ah, I didn't realize it was showing two different ways to do things on that page, was just scanning it quick. I ended up copying the example for the delegate which still tries to call the method as it were using ILazyLoader
. I added a comment below to the code
private Blog(Action<object, string> lazyLoader)
{
LazyLoader = lazyLoader;
}
private Action<object, string> LazyLoader { get; set; }
public int Id { get; set; }
public string Name { get; set; }
public ICollection<Post> Posts
{
// this isn't valid, maybe it should be LazyLoader.Invoke(this, "_posts")
get => LazyLoader.Load(this, ref _posts);
set => _posts = value;
}
Type of issue
Typo
Description
The article uses
Action<object, string>
for the type oflazyLoader
, but there is an interfaceILazyLoader
which should be used.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