I created new ASP.NET Core project with Identity Individual User but it did not create any database.
I have to use add-migration update-database manually.
I remember, in the past, everything was done automatically. Dunno what's wrong this time.
VS2017.3
If you want to create a database schema only, you may call:
//IDbContext context;
context.Database.EnsureCreated();
But note, that
EnsureCreatedtotally bypasses migrations and just creates the schema for you, you can't mix this with migrations.EnsureCreatedis designed for testing or rapid prototyping where you are ok with dropping and re-creating the database each time. If you are using migrations and want to have them automatically applied on app start, then you can usecontext.Database.Migrate()instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With