Get Started With Reverse Engineering — EF Core Power Tools
According to Wikipedia,
“Reverse engineering is the process of discovering the technological principles of a device, object, or system through analysis of its structure, function, and operation.”
In this article, we are going to focus on EF Core Power Tools, the new version of Entity Framework Core that helps in the development process.
EF Core Power Tools provides a lot of functionalities like Reverse Engineering to generate the Entity Classes based on existing database tables and also to generate a model diagram…
How can this Tool help in the development process?
Using this tool, we can perform Reverse Engineering and generate all classes we want from an existing database without creating them and risking to misspell an attribute or FK relationships.
What is the Reverse Engineer option in EF Core Power Tools up to?
Reverse Engineer has the role of the Entity Data Model, which transforms the tables in the existing database to C# classes with a DbContext class.
To download this tool, click here.
To install this tool, you must have at least Visual Studio 2017 on your machine.
How to install EF Core Power Tools?
After having downloaded the tool from the Visual Studio marketplace, click and install.
In case the installation takes longer than expected, restart Visual Studio.
After creating the Entity Project that will hold your entities classes, right-click on this project and you will find a new option called EF Core Power Tools.
There you go! Your tool is successfully installed.
How to use Reverse Engineer via EF Core Power Tools?
1- Click on Reverse Engineer and add your database connection option.
2- After connecting to your database, it will be shown in the select options.
3- Select the tables you want to generate in your project.
4- You can select some specifications about your generated classes names and the DbContext name.
Finally, you can observe that your model classes and the Db Context are generated.
Thanks for reading!