Pre-Requisites
To work with Boilerplate Entity framework, you should have the following tools installed in your system.
-
Visual Studio 2017,
-
MS SQL Server,
-
Visual Studio extensions – Web compiler, Bundler, and Minifier,
-
Active internet connection.
Let us understand in a basic way, how Boilerplate Entity framework is used in WebAPI Application development using Code First approach.
Before proceeding further, it is necessary to have basic knowledge about the Entity framework, how it is used in the application, and its integration in the project, what is Application layer, Business layer, Database layer. And importantly, you need to add Abp.EntityFramework to your project from the nuget package.
When you are using Entity Framework in the project for creating the application, first you need to define DbContext class in the application
A major benefit you will have while using Boilerplate Entity Framework is, the classes will be mapped to database tables in a conventional way. Hence you do not require to make any sort of configurations.
The entities are linked to Entity Framework context by adding each one of them a property just like the below instance.
public IDbSetMyExampleClass { get; set; }
And to update the database while working on the project, you can use migration tool which is inbuilt in Entity Framework. It provides two types of Migration modes- Manual and Automatic.