Thursday, May 4, 2023

EF Core Power Tool - To generate DB Context

 Nice tool with a lots of customization to generate the DB Schema. 

EF Core Power Tools 

There are lot of material available on how to get started and it is very straight forward to start using it. 

Best thing I like about this and why I used it to customize the name of the Class which is being generated. If you have multiple table with the same name but in the different schema, by default the class name are appended with 1,2. 

For example,

If you have two tables, 

Local.Customer
Master.Customer

Then default EF core will generate the class name as Customer & Customer1. Not that intuitive. 

With EF Core Power Tools, You can customize the class name generation. 

Create a new file with the name "efpt.renaming.json" and put it inside the same folder as your "efpt.config.json".





    







You can also customize the columns inside a table. 

* If you are renaming multiple tables from a single schema, add all of them in the same Tables array. 

 I would try to create a small video some time and share the link.

Until next Cheers!


 

 


No comments:

Post a Comment