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:
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.
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:
18.191.157.197