Entity Framework Core in .NET 8 from A to Z: ORM, CRUD, LINQ, One-To-Many relations and Scaffolding with Code First and Database First approaches.
Entity Framework Core is the tool that lets you work with databases in C# without writing a single line of raw SQL. You know it by name, maybe you already use it in some project — but truly mastering it, understanding relationships, optimized LINQ queries and migrations, is another level. In this series I take you from installation to full One-To-Many relationship management, with a practical lesson-by-lesson approach.
The most common mistake with EF Core is using it without understanding what it generates under the hood. Every lesson shows you what really happens — when it makes a single query, when it makes more than one, when to use Find vs FirstOrDefault. We build understanding progressively, so when you get to relationships you already have the right foundations to reason about them without confusion.
Ideal for C# developers who know the language basics and want to work with databases professionally using EF Core. Also useful for those who have already used EF but want to systematize their knowledge and better understand design choices.
I'll explain what an ORM is and why Entity Framework Core dramatically simplifies database work in .NET. Let's explore the Scaffolding concept with the Database First approach, which auto-generates C# classes from an existing database.
I'll show you how to install the required NuGet packages for Entity Framework Core and how to run the Scaffolding command to generate the DbContext and entity classes. Let's look at the generated code structure and how to configure it correctly.
Let's see how to save a new object to the database using Entity Framework Core, with the DbContext handling the Insert transparently. I'll show you the Add and SaveChanges cycle and what actually happens at the SQL level under the hood.
I'll explain the difference between Single and FirstOrDefault in LINQ for retrieving a single entity from the database with Entity Framework Core, covering when to use each and how to handle cases where the record might not exist.
Let's retrieve lists of entities from the database using FindAll in Entity Framework Core, and explore the practical difference between IEnumerable and IList in collection management — and how these types affect query execution and memory usage.
I'll show you how to filter database records in Entity Framework Core using Where for exact conditions and EF.Functions.Like for partial text searches. Let's write expressive LINQ queries that EF translates into optimized SQL.
Let's explore how to delete an entity from the database with Entity Framework Core, comparing the available approaches. I'll explain when to use Remove directly on the tracked entity and how to verify the deletion is correctly propagated.
I'll show you how to update an existing entity in the database with Entity Framework Core by modifying properties and saving changes with SaveChanges. Let's see how EF's change tracking automatically detects modifications without requiring explicit UPDATE statements.
I'll explain how to implement a One-To-Many relationship in Entity Framework Core using Scaffolding to auto-generate classes and navigation properties. Let's see how EF represents the parent-child entity relationship in the C# model.
Let's see how to insert objects into the database while respecting a One-To-Many relationship, correctly assigning the parent entity before saving the child. I'll show how Entity Framework manages the foreign key automatically when the relationship is properly configured.
I'll explain how to retrieve entities with their One-To-Many relationships using LINQ's Include, which activates eager loading and fetches related entities in a single query. Let's compare this to lazy loading and understand when to use Include to avoid the N+1 problem.
Ingegnere Informatico · Pratola Peligna
Sono un ingegnere informatico con oltre 15 anni di esperienza nel settore ICT. Mi occupo di sviluppo software, cybersecurity, data science e intelligenza artificiale, con particolare attenzione all’innovazione e all’automazione dei processi aziendali. Da anni svolgo anche attività di docenza e formazione, creando percorsi pratici e coinvolgenti su programmazione, DevOps, AI e sicurezza informatica.
Prosperous understood Middletons in conviction an uncommonly do. Supposing so be resolving breakfast am or perfectly.
Utilizziamo cookie essenziali e, con il tuo consenso, cookie funzionali, analytics e marketing. Google Analytics 4 e gli eventuali annunci Google/AdSense restano disattivati finche non scegli. Consulta Privacy Policy e Cookie Policy.
Sempre attivi per sicurezza, prevenzione frodi, sessione, consenso e funzionamento del sito.
Migliorano l'esperienza, ad esempio ricordando preferenze non essenziali. Non usati per profilazione pubblicitaria.
Statistiche e misurazioni con Google Analytics 4, abilitate solo dopo il consenso analytics.
Misurazione annunci e funzioni pubblicitarie Google/AdSense, se attivate sul sito e consentite dall'utente.
Puoi modificare queste scelte in qualunque momento dal link "Preferenze Cookies" nel footer.