Chapter 8. Working with Databases Using the Entity Framework Core

This chapter is about reading and writing to databases, such as Microsoft SQL Server and SQLite, using the object-relational mapping technology known as the Entity Framework Core.

This chapter will cover the following topics:

  • Relational Database Management Systems
  • Using Microsoft SQL Server on Windows
  • Using SQLite on macOS and mobile platforms
  • Setting up Entity Framework Core
  • Querying an EF Core model
  • Manipulating data with EF Core

Relational Database Management Systems

One of the most common places to store data is in a Relational Database Management System (RDBMS). Common ones include Microsoft SQL Server, Oracle, and SQLite.

Using a sample database

To learn how to manage a database using .NET Core, it would be useful to have a sample one to practice on that has a medium complexity and a decent amount of sample records. Microsoft offers several sample databases, most of which are too complex for our needs. So, we will use a database that was first created in the early 1990s known as Northwind.

Use the link https://github.com/markjprice/cs7dotnetcore/tree/master/VSCode/Chapter08 to download the Northwind.sql file for use with Microsoft SQL Server on Windows, or the NorthwindSQLite.sql file for use with SQLite on macOS or mobile platforms.

Here is a diagram of the Northwind database that you can refer to as we write queries:

Using a sample database

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.157.197