In this article we are going to study the EF – Core Power Tools essentially the new model of EF Core is relatively easy to use like Entity Data mannequin which we are already used in .NET Framework and this EF Core Power Tools assist in the improvement process. Let’s go deep into this.
What are EF Core Power Tools?
EF Core Power Tools is the most effective extension. It affords a lot of picks like Reverse Engineer to generate the Entity lessons primarily based database tables and additionally to generate the Model Diagram. It additionally helps with the Migration of Existing Scripts which have been developed with the aid of the usage of the Code First Approach. EF Core Power Tools has an alternative to generate the DataContext Diagram and relation between the entity training in a graphical view.
How does this tool help me?
With this tool, we can take an present Database and function a Reverse Engineer, which capability producing all instructions from your present database.
What is Reverse Engineer in EF Core – Power Tools?
Reverse Engineer acts like Entity Data Model, the place it generates the tables of our database as Entity Classes in the code and additionally Db Context classification bases upon our Database.
Link to Download :
Make Sure you have at least Visual Studio 2017 + or latest set up on your computing device to work with EF Core.
After downloading, Click, and install. But do not forget about to restart Visual Studio to whole the installation.
Create a Project:
- Open Visual Studio there you will discover an choice referred to as Create a new assignment Click on that
- Select ASP.NET Core Web Application -> Click on the Next button.
- Give the Project Name and click on on Create.
- Select the Version of ASP.NET Core 3.1 alongside with API and click on on Create.
A pattern challenge with API Structure will be created.
Right Click on Project there you will locate an alternative installed, EF Core Power Tools
Click on Reverse Engineer there you will discover the Db Connection Option.
Click on Add to join with Database Server
- Provide the SQL Server title in the Text Box and locate whether or not you are the usage of Windows or SQL Authentication.
- Select the Database Under the Select or enter the database.
- Click on Test Connection to test the place the connection is configured in a ideal way.
- Click on OK.
That’s done! The Connection with the database will exhibit in the chosen DropDown -> Click on OK.
Select the Tables which you choose to consist of in your assignment and click on on OK.
By default, it will add the DB title as Context title you can alternate if you favor and additionally it will pick out Entitytypes & DbContext with the aid of default Click on OK.
You will get a confirmation, as proven below.
Finally… The model Classes with Db Context have been generated automatically. This is how easy it is to work with EF Core Power Tools.
In this article, realized about the integration and utilization of EF Core Power Tools in ASP.NET Core Web API.
I hope this article helps you.