ASP.NET Core Web API + Entity Framework Core : Loading Related Data | Eager Loading - EP04

Опубликовано: 28 Сентябрь 2024
на канале: CuriousDrive: Solve Coding Problems & Win Prizes!
33,636
439

Hey Coders,

Subscribe here -    / @curiousdrive  
Talk to us on -   / curiousdrive  

Like our page -   / curiousdrive  
Follow us on -   / curious_drive  
Follow us on -   / curiousdrive  

Make a donation - https://www.paypal.me/curiousdrive
Be a member -   / curiousdrive  

Find Code here - https://github.com/CuriousDrive/BookS...

In this #EntityFramework tutorial, I am showing how you can use Include() and ThenInclude() functions to load related from your DB.

Content -
1. #JsonException
2. #Include
3. #ThenInclude

Code to add at startup.cs -
Note : YouTube does not allow angle brackets so please replace it in your code before running.

services.AddMvc(option =(angle bracket) option.EnableEndpointRouting = false)
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
.AddNewtonsoftJson(opt =(angle bracket) opt.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore);

#CuriousDrive #WeLoveCoding