Why Work with Eager Loading in Entity Framework Core 6

How did we handle the above-mentioned challenges related to data loading and eager loading in particular?

  • Eager loading: A process in which the related data is loaded from the database as part of the initial query.
  • Lazy loading: The related data is transparently loaded from the database when the navigation property is accessed.
  • Explicit loading: The related data is explicitly loaded from the database at a later stage.

Why did we choose Eager Loading?

  1. We needed to send chunks of data (not all objects at once but part of the objects with all their relevant properties loaded) on the load page event.
  2. There were heavily nested properties with depth of around 7 levels/layers.
  3. Entity Framework have a build-in feature to automatically build and manage navigation properties (also known as relationship fix-up) even reuse them if they were loaded before and that without the need to access the database again.

Let’s dive deeper into EFC 6 Eager Loading

Lastly, my personal experience

--

--

Software engineering and consulting services that help you expand your digital footprint. We promise a focus on excellence and transparency in everything we do.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store