Use dotnet run /seed throw error
See original GitHub issueUse dotnet run /seed
is error, But use dotnet ef database update
is ok, Unable to create database automatically in Docker.
Issue Analytics
- State:
- Created 5 years ago
- Comments:24 (24 by maintainers)
Top Results From Across the Web
Unable to seed database with EF Core
When I run the project, I don't get any build errors or exceptions but the database does not seed and I get a...
Read more >Migrations and Seed Data With Entity Framework Core
We are going to learn about Migrations and Seed data in Entity Framework Core and how to optimize EF Core migrations.
Read more >Re-thinking Running Migrations and Seeding in ASP.NET ...
In Entity Framework Core, I've been using an approach to run migrations and ... It throws an error and all work stops (sure...
Read more >Exception while executing dotnet run --migrate-database #4508
I have implemented data seeding using IDataSeedContributor and it is working fine with ./migrate-database. But I'm looking to migrate on runtime ...
Read more >Seeding data using EF Core in ASP.NET Core 6.0 Minimal ...
In order to seed the data, we are going to write a data seeding class to inject certain data while our application starts...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@skoruba Great, I tested it is working fine. Thanks
This basically boils down to either issuing those commands (which you can automate in Dockerfile if I understand correctly) or adding to code for each of 4 builtin contexts:
context.Database.Migrate();
From my POV it’s a matter of preference and I would like the community to voice their preferences.