5

I have created a ASP.NET Core 2.1 project With "Database first" approach and Razor Pages (no MVC). All my models are generated from the database context.

I successfully created CRUD Razor Pages for one of my models with a command line like this one :

dotnet aspnet-codegenerator razorpage -m Student -dc RazorDemoContext -udl -outDir Pages\Students

I have approximatively 50+ models. Is there a command line to generate CRUD Razor Pages for all models at the same time and not just one by one ?

Thank you

habib
  • 2,366
  • 5
  • 25
  • 41
Jeremy
  • 75
  • 1
  • 3

1 Answers1

0

I suggest you produce the whole list of script by using a SELECT statement against your database :

select 'dotnet aspnet-codegenerator razorpage -m '+  name +' -dc RazorDemoContext -udl -outDir Pages\'+name+'s' 
    from sysobjects 
    where type = 'U'
Carl Verret
  • 576
  • 8
  • 21