ARLCode ARLCode - 1 year ago 147
C# Question

Lazy Loading Examples?

I'm building a basic MVC Core Web API and trying to connect using Entity Framework, I came across something called "Lazy Loading" and I can't seem to wrap my head around what Lazy Loading is revolving EntityFramework?

When is Lazy Loading used and how does it benefit?

Answer Source

In my opinion, Lazy loading is the process when an entity or collection of entities is automatically loaded from the database.

Actually, the sorting and retrieval algorithms are being applied on the user side, while query gets all the data. By the default the Lazy Loading feature is ON, but can be turned off manually, or you can construct clever queries, i.e. using IQueryable, which does the filtering on Server side and retrieves only those records, which are required. In practices, it will help you to save a lot of time and resources, by preventing the heavy traffic and overloading server

Better answer is on this website->

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download