How to Scaffold Database tables in easy way?

Viewed 92

I have a database with many tables. I want to scaffold it with my ASP.NET Core 6.0 MVC project. Problem is: I do not want all the tables but only some of them.

Let's say there are 100 tables and I want to scaffold only 40 of them.

I know the command

Scaffold-DbContext "Server=;Database=;user id=;password=;" Microsoft.EntityFrameworkCore.SqlServer 
        -OutputDir -Tables

but in this way, I'd have to write all the tables' name 1 by 1.

Is there an easy way that I can scaffold many tables or is there a command to scaffold the ones starting with an 'a'?

2 Answers
Related