How to add model name suffix for EF Core scaffold db?

77 Views Asked by At

Is it possible for me to tell the command dotnet ef dbcontext scaffold to add a suffix of Entity to all the models it makes?

Use case, I have a table called Users. I want EF Core to create a model called UsersEntity. Is this possible with a flag or am I going to have to do something like this + mass string replace in all the .cs files?

1

There are 1 best solutions below

0
jessiebot On

I am trying do the same thing.

My plan is to use the Entity Framework Core templates to add a suffix to all my entities when scaffolding.

See https://learn.microsoft.com/en-us/ef/core/managing-schemas/scaffolding/templates?tabs=dotnet-core-cli for instructions about how to setup the template.