✅ New to Blazor and EF. Need some tips.
I'm trying to set up a site that will have dozens of db models. I don't want to manually create CRUD pages for each model if possible, but I'm brand new to both Blazor and EF. I'm currently lost in documentation hell and can't seem to find a good way to use automatic routing to generate CRUD pages for my models. Any suggestions, links, or code samples would be incredibly helpful.
4 Replies
https://www.entityframeworktutorial.net/efcore/create-model-for-existing-database-in-ef-core.aspx does this help?
you can scaffold both models and CRUD templates
I'm unfortunately using VS Code and don't have the option to scaffold.
That also would result in about... 160 different files for CRUD...
dotnet ef dbcontext scaffold "<your existing db connection string>" Microsoft.EntityFrameworkCore.SqlServer -o Models
make sure you have
Microsoft.EntityFrameworkCore.Tools.DotNet (2.0.3 or latest) in your project.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.