ASP.NET Core 6: Creating API for CRUD Operations using EntityFrameworkCore (Basic for new ASP.NET Core Learners): Part 2
In Part 1 , we have gone through the basic understanding of creating an ASP.NET Core Web API project. In this part, we will see how we can use EntityFramework Core (EF Core) to build Data Access Layer and create WEB API. EntityFramework Core The EntityFramework Core is a cross-platform Object Relational Mapping (ORM). This provides an object model that manages database connections and mapping with tables of the database. The DbContext class provided in EF Core is used to manage database connections and performs commit transactions. The DbSet<T> generic in EF Core represent the entity class aka CLR Object mapping with a table of the database. Here we can say that T is an entity class mapped with the table of a database named T. The EF Core provides the following two approaches: Database First: The Entities and DataAccess layer is created based on the ready-to-use database Code-First: The Database and its tables are created using entities we create in the proj...