Bread
Bread

Reputation: 443

Excluding tables with database first approach

Is there a way to exclude tables when running the Scaffold-DbContext command?

I tried something like

Scaffold-DbContext -provider EntityFramework.MicrosoftSqlServer 
       -connection "xxx" -OutputDirectory Models 
       -Tables "dbo.a,dbo.b,dbo.c,dbo.d"

but I get Build failed

Upvotes: 8

Views: 3700

Answers (1)

Dr. Stitch
Dr. Stitch

Reputation: 918

The Tables parameter accepts single dimensional string array, you just need to change it to array format:

"dbo.a", "dbo.b", "dbo.c"

Thanks Bread!

Upvotes: 5

Related Questions