Introduction

Completed

In this module, you'll gain an understanding of object-relational mappers (ORMs) and Entity Framework (EF) Core. You'll use EF Core to persist and retrieve relational data from a database.

Example scenario

Suppose you're an employee of a pizza company named Contoso Pizza. Your manager has asked you to develop a RESTful web API service as a prerequisite for the company's web storefront and mobile application. The service will support adding, viewing, modifying, and removing types of pizza in the company's database. These four operations are often referred to as Create, Read, Update, Delete (CRUD).

Learning objectives

In this module, you will:

  • Review object-relational mapper (ORM) concepts.
  • Understand Entity Framework Core (EF Core) architecture.
  • Write C# code to interact with a database using EF Core.
  • Use EF Core Migrations to keep the code and database in sync.
  • Use reverse engineering to generate entity models from an existing database.
  • Seed a database on app startup.

Prerequisites

  • Experience writing C# at the beginner level
  • A basic understanding of relational databases
  • Visual Studio Code
  • .NET SDK 6.0 or greater
  • Git command-line client