Complete Entity Framework Core Tutorial

The Complete Entity Framework Core Tutorial or EF Core Tutorial covers everything from creating an EF Core application, Connecting to a database, Creating Context & DbSet. Modeling the Database using Conventions, Data Annotations & Fluent API. Learn to Query, Insert, Update & Delete Records from the database using EF Core. This is a step by step guide to the EF Core Using C#. This tutorial is aimed at both beginners & professionals to learn all the features & concepts of the Entity Framework Core.


  • C#
  • Visual Studio 2019
  • MS SQL Server and Querries

What is Entity Framework Core

The Microsoft Entity Framework Core or EF Core is Microsoft’s implementation of  ORM Framework.  The applications created using the EF does not work with the database directly. The application works only with the API provided by the EF for database related operations. The EF maps those operations to the database.

Table of Content

1. Getting Started

This Getting Started Tutorial guides you through the process of creating your first EF Core Application from scratch.

  1. Getting Started: Create your First Entity Framework Console Application 
  2. Installing EF Core

2. Connecting to Database

  1. Database Connection String
  2. DBContext
  3. DbSet

3. Configuring the Model

The Following Tutorials Explains how to Configure the Models using Convention, Data Annotations & Fluent API

3A. Configure Using Conventions

  1. Code First Conventions in Entity Framework Core 

3B. Configure Using Data Annotations

  1. Data Annotations in entity framework Core 
  2. Table Attribute
  3. Column Attribute
  4. Key Attribute
  5. ComplexType Attribute
  6. ConcurrencyCheck Attribute
  7. Timestamp Attribute
  8. Databasegenerated Attribute
  9. ForeignKey Attribute
  10. MaxLength / MinLength Attribute
  11. StringLength Attribute
  12. NotMapped Attribute
  13. Required Attribute
  14. InverseProperty Attribute

3C. Configure Using Fluent API

  1. Fluent API Entity Framework Core
  2. Ignore Method
  3. HasAlternateKey
  4. HasKey
  5. EntityType Configuration

4. Configuring the Relationships

Learn how to Configure the Relationships in Entity Framework  by using Navigation property and making use of Conventions, Data Annotations & Fluent API

  1. Relationships & Navigational Properties
  2. One to One Relationships
  3. One to Many Relationships
  4. Many To Many Relationships

5. Querying in EF Core

Querying in Entity Framework Core has not changed from its predecessor Entity Framework. The LINQ To entities is now the preferred way of Querying the Entities. The Following Articles introduces you to the LINQ to Entities in EF Core and shows how to Query, Find a Single Entry, Join two or more tables. Inner join & Left Joins, Select Query, sort & Filter etc.

  1. Querying in Entity Framework Core
  2. First, FirstOrDefault, Single, SingleOrDefault in EF Core
  3. EF Core Find Method
  4. Projection Queries in EF Core
  5. EF Core Join Query
  6. Eager Loading using Include & ThenInclude in EF Core
  7. SelectMany in EF Core
  8. Explicit Loading in EF Core
  9. Lazy Loading in EF Core

6. Persisting the Data

  1. Save Changes in Entity Framework Core
  2. ChangeTracker, EntityEntry & Entity States
  3. Add Records/Add Multiple Records
  4. Update Record
  5. Delete Record
  6. Cascade Delete in Entity Framework Core

7. Migrations

  1. EF Core Migrations
  2. Reverse Engineer Database (Database First)
  3. EF Core Data Seeding to the Database
  4. EF Core Script MIgration

8. Others

  1. Logging in EF Core
  2. Using MySQL & MariaDB in Entity Framework Core

9. Resources

  1. Best Books on Entity Framework Core

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top