
Explore EF Core and its full feature set to speed up dotnet development by creating and changing schemas with C-sharp syntax and Linq for web and desktop apps.
Explore the EF core toolset, focusing on Visual Studio 2022 and Visual Studio Code, and using dotnet CLI across Windows, Mac, and Linux with core versions 6, 7, and 8.
Install Visual Studio 2026 Insider Preview by downloading the Community edition, select workloads like ASP.NET web development, MAUI, Azure, and desktop development, and sync settings from Visual Studio 2022.
Install the dotnet SDK (preferably dotnet seven), install and update the EF Core global tools, verify with dotnet --info, and run dotnet-ef commands from the command-line interface on all platforms.
Explore Entity Framework Core in code setup, learn data models, and see how it uses them. Cover code-first and database-first development, migrations, and data seeding.
Define data models as classes mapping to database tables, with properties as columns and types aligned, using conventions that yield auto-incrementing integer ID as primary key in Entity Framework Core.
Define coach and team models in EF Core, using a base domain model for fields, enforce primary keys and nullable fields, and implement in Visual Studio or VS Code.
Define a public class that inherits from DbContext, add DbSet<Team> teams and DbSet<Coach> coaches, and prepare to override OnConfiguring for EF Core settings.
Explore how EF Core connects to databases via providers, including Microsoft and third-party options, and configure the SQLite connection string for this course. Learn about in-memory testing and on configuring.
Create a console app named Entity Framework Core dot console, install EF Core design package, and wire it to the data project with a project reference for the DB context.
Learn how to create migrations in EF Core using the package manager console and dotnet ef, set the startup project, name migrations, and understand up and down methods for SQLite.
Use update-database to create a code-first database, apply migrations, and update the snapshot; for multi-project setups run dotnet ef database update and inspect with sqlite or sql server tools.
Reverse engineer an existing database by scaffolding a DbContext and models from a SQL Server database, using a connection string and directing output to scaffold context and scaffold models folders.
Reviewing the section, we set up data, domain, and application projects to illustrate separation of concerns. We cover core tools, migrations, scaffolding, and reading data from the SQLite database.
Configure EF Core to log converted SQL statements to the console using the options builder, enabling information level, sensitive data logging (educational use only), and detailed errors for debugging.
Explore language integrated query (Linq) in C#, translating queries to SQL, and compare query syntax with method syntax using lambda expressions to filter collections.
Explore how asynchronous EF Core queries and save changes async avoid thread blocking, using await to enable more concurrent, efficient database operations while noting single context limits.
This lecture demonstrates how to query a single record in entity framework core using first, first or default, single, single or default, and find async, including where clauses and lambdas.
Explore filtering in Entity Framework Core with where clauses and lambda predicates, including async to list calls. Learn to use console input, parameterized queries, and basic protection against SQL injection.
Learn to filter in EF Core using where and contains for partial matches, translating to sql like, and compare contains with like when searching team names for fc.
master ordering data in entity framework core by using order by with ascending or descending, and retrieve extreme values with max by or min by.
Explore skip and take for efficient paging in Entity Framework Core: learn to skip pages, take a subset, and let the database handle limits.
Disable tracking for read-only queries to improve performance, using AsNoTracking or per-query options, and optionally configure a global setting with UseQueryTrackingBehavior to disable tracking overall.
Compare IQueryables and lists to optimize database queries, showing how building filters with as variable and finalizing with to list async yields precise, memory-efficient results.
Explore inserting data with EF Core through loop and batch scenarios by creating domain objects, using add or add range, saving changes, and reviewing the change tracker for added entities.
Master simple update operations in Entity Framework Core, comparing tracking and no-tracking, and learn how the change tracker updates only modified fields.
Delves into write operations in Entity Framework Core, including insert, update, and delete, along with change tracking, batching, and save changes placement for efficient transactions.
Master adding and updating migrations in EF Core, troubleshoot seeding with nullable fields, rename and redesign keys, and safely apply updates across multiple contexts using the Package Manager Console.
Learn how EF bundles provide a standalone executable to apply migrations without dotnet tools, enabling reliable CI/CD, true idempotent execution, and controlled production deployment.
Define and classify database relationships in entity data models, including one-to-many, one-to-one, and many-to-many, with examples of leagues, clubs, and matches, and explain navigation properties in core data models.
Configure the match entity to support a many-to-many relationship between teams with home and away navigation properties, using a linker table and explicit foreign keys.
Explore how to model a one-to-one relationship in EF Core, using team and coach as examples, choosing a parent entity, and configuring navigation properties and optional and required constraints.
Implement a one-to-one relationship between team and coach with navigation properties, initialize collections to empty lists, and run migrations to add the foreign key while debugging not null errors.
learn to insert related data in EF Core, including single and parent-child inserts, and create related coach, team, and league objects in one save operation.
Eager loading, lazy Loading and Explicit Loading
Explore eager loading with Entity Framework Core by using include, optimize with split query, filter included data, and traverse nested relations like leagues, teams, and coaches while considering tracking.
Install the Entity Framework Core Proxies package and enable lazy loading in the dbcontext. Mark navigation properties as virtual to load related data on demand; understand N plus one problem.
Use projections and anonymous types to project multi-table data into a custom Team Details type, retrieving team id, team name, coach name, and total home and away goals via sums.
Explore delete behaviors in EF Core, including cascade, restrict, set null, and no action, and learn how to apply them to foreign keys and migrations.
Explore how to mix raw sql with linq in EF Core, use from sql interpolated and execute sql interpolated for updates and deletes, and understand stored procedures and sqlite limitations.
Learn to query scalar and non-entity types with EF Core using SQL queries. See parameterized SQL, mapping to custom data types, and retrieving specific columns via context database query.
Map a user defined function to the DbContext using has db function to call the database function get earliest match, which returns a date time, then execute it via the context.
Wrap up the section by exploring raw SQL in migrations, handling views and keyless entities, and using FromSqlRaw or FromSqlInterpolated for parameterized queries in EF Core.
Explore configuring an ASP.NET Core web app to use EF Core for data access. Review dependency injection setup and best practices for EF Core integration.
Explore how ef core works with asp.net core in web apps, using disconnected on-demand contexts with no tracking, and configure via appsettings.json and dependency injection.
Set up a new ASP.NET Core Web API project, configure controllers and launchSettings.json, and prepare appsettings.json, program.cs, and dependency injection to enable database interaction.
Connect the web app to the data project by adding a project reference and registering the football league db context with dependency injection, using appsettings.json for sqlite connection strings.
Learn to scaffold a database interaction template for an api project and fix design time EF Core errors by implementing a design time db context factory and configuring options.
Scaffold an async api controller with Visual Studio Code and the dotnet CLI, generating TeamsController from the Team model and FootballLeagueDbContext using code generation.
Explore scaffolded API controller using dependency injection with a football db context, perform CRUD operations, optimize delete with execute delete, manage no-tracking queries and concurrency checks.
Review best practices for web APIs by using swagger UI to test endpoints, project teams into DTOs, and prevent cycles with json options.
Explore advanced core configurations in Entity Framework Core, including overriding save changes, audit values, annotations versus fluent API, transaction support, and concurrency handling.
Learn to override save changes in Entity Framework Core to auto-populate audit fields for added and modified entries using the change tracker.
Enable SQL Server temporal tables in EF Core to audit data with system versioned history and valid from and valid to timestamps.
Learn to detect and resolve concurrency conflicts in databases using optimistic concurrency with a row version token. Implement safe save changes and handle concurrency exceptions across SQL Server and SQLite.
Explore global query filters that apply a predicate to all entity queries, enabling soft deletes and multi-tenant setups; configure with builder.HasQueryFilter and optional ignore query filters for admins.
Overview
In this course, Entity Framework Core - A Full Tour, you will learn to work with data in your .NET applications.
When courses are created for .NET technologies, the details of Entity Framework and its sheer power are often neglected. We get distracted by abstractions and layers and need to focus on what Entity Framework is doing and can do.
In this course, we will review the general benefits of using Entity Framework Core, which is Microsoft’s flagship Object-Relational Mapper (ORM), to relieve you of many concerns and challenges that come with this component of software development. We will also discover how EF Core translates classes and references into database models and Relationships.
We will learn how to write queries, update databases incrementally, roll back changes, and explore the myriad capabilities that Entity Framework Core affords us. This course is compatible with .NET 6 / .NET 7 / .NET 8.
When you finish this course, you’ll have the skills and knowledge of Entity Framework Core needed to easily interact with data and write queries for .NET Core applications.
By the end of this course, you'll be able to:
Construct a data model using code-first and database-first workflows.
Understand Entity Framework Commands for all operating systems.
Use migrations to manage database changes.
Apply Database validations and constraints.
Perform CRUD operations using LINQ.
Apply best practices with Entity Framework.
Extending Data Contexts
Understand how Change Tracking works.
Manage Database Structure using Fluent API
Handle One-To-One, One-To-Many and Many-To-Many Relationships
PREREQUISITES
To take this course, you should have at least three months of experience programming in C#. If you need to strengthen your C# fundamentals, you can take my C# beginner course C# Console and Windows Forms Development with LINQ & ADO .NET.
You can also explore Database Development, which you can look at in the Complete Microsoft SQL Server Database Design Masterclass course.
Content and Overview
To take this course, you will need to know C#. Even if you have little exposure to the .NET development stack, this course is beginner-friendly and has development tips.
This premium course is smartly broken up to highlight related activities based on each module in the application being built. We will also look at troubleshooting and debugging errors as we go along, implementing best practices, writing efficient logic, and understanding why developers do things the way they do. Your knowledge will grow, step by step, throughout the course, and you will be challenged to be the best you can be.
The course includes working files hosted on GitHub to make it easier for you to replicate the demonstrated code. You will be able to work alongside the author as you work through each lecture and will receive a verifiable certificate of completion upon finishing the course.
Clicking the Take This Course button could be the best step to increase your income and marketability quickly! Also, remember that if you think the course is not worth your spending, you have a full 30 days to get a no-questions-asked refund!
It's time to take action!
See you in the course!