You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documentation improvement about data-seeding #4703
After days of banging my head against the wall, trying to figure out why my initial users and roles were not being created, googling for solutions, searching StackOverflow, asking ChatGPT, reading ASP.NET source code, and with no success after many, many, many, many, maaaaaaaaaaaany hours of stress and headaches, I realized by accident that if I delete my migrations, then OnModelCreated does seed the data.
It looks like Entity Framework only applies data seed from model.Entity<Foo>.HasData(bar) when creating migrations.
So, my suggestion is to make it clear that data is ONLY seeded during the migration creation phase, NOT during runtime.
Activity
Expand and clarify migrations guidance. (dotnet#5445)