Scott Software
Scott Software

Reputation: 499

ef core 2.0 scaffold-dbcontext custom namespace

I am using the ef core 2.0 CLI command scaffold-dbcontext to reverse engineer poco classes from an existing DB (database first). I want to put the generated classes from scaffold-dbcontext in a "Model" folder within my project but I want the namespace of the classes to be something different than "MyProjectName.Model". For example, I want the scaffold-dbcontext generated files to live in the Model folder but I want the namespace of the genereated files to be "MyProjectName.Entities".

Is there a way to control the generated namespace with the scaffold-dbcontext cli command?

(To give you a little background, I want to define the custom namespace in the generated pocos so I can have a separate set of partial classes in another folder which won't be overwritten by regenerating the model using scaffold-dbcontext).

Upvotes: 2

Views: 2164

Answers (1)

Roman Patutin
Roman Patutin

Reputation: 2210

Currently no way to specify namespace, but similar issue open for ef 2.1 milestone.

So I hope it will be fixed in the next version.

Upvotes: 3

Related Questions