EF Core and database mappings
We are using EF Core in this application. EF Core is an Object-Relational Mapping (ORM) provider provided by Microsoft. ORMs provide abstractions to make you feel like you are working with objects in your application code rather than the database tables. We will cover ABP's EF Core integration in Chapter 6, Working with the Data Access Infrastructure. However, for now, let's focus on how we can use it practically.
First, we will add entities to the DbContext
class and define the mappings between entities and database tables. Then, we will use EF Core's Code First Migration approach to build the necessary code that creates the database tables. Following this, we will look at ABP's Data Seeding system to insert some initial data into the database. Finally, we will apply the migrations and seed data to the database to prepare it for the application.
First, let's start by defining the DbSet
properties for the entities.