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.
Table of Contents
Prerequisite
- 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.
2. Connecting to Database
3. Configuring the Model
The Following Tutorials Explains how to Configure the Models using Convention, Data Annotations & Fluent API
3A. Configure Using Conventions
3B. Configure Using Data Annotations
- Data Annotations in entity framework Core
- Table Attribute
- Column Attribute
- Key Attribute
- ComplexType Attribute
- ConcurrencyCheck Attribute
- Timestamp Attribute
- Databasegenerated Attribute
- ForeignKey Attribute
- MaxLength / MinLength Attribute
- StringLength Attribute
- NotMapped Attribute
- Required Attribute
- InverseProperty Attribute
3C. Configure Using Fluent API
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
- Relationships & Navigational Properties
- One to One Relationships
- One to Many Relationships
- 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.
- Querying in Entity Framework Core
- First, FirstOrDefault, Single, SingleOrDefault in EF Core
- EF Core Find Method
- Projection Queries in EF Core
- EF Core Join Query
- Eager Loading using Include & ThenInclude in EF Core
- SelectMany in EF Core
- Explicit Loading in EF Core
- Lazy Loading in EF Core
6. Persisting the Data
- Save Changes in Entity Framework Core
- ChangeTracker, EntityEntry & Entity States
- Add Records/Add Multiple Records
- Update Record
- Delete Record
- Cascade Delete in Entity Framework Core
7. Migrations
- EF Core Migrations
- Reverse Engineer Database (Database First)
- EF Core Data Seeding to the Database
- EF Core Script MIgration