Skip to content

Comment out FillinDatabase(); in program.cs before add-migration #49

@ddepassUSOM

Description

@ddepassUSOM

error
To get the project to work I had to do the following:
BEFORE EXECUTING -->

"Inside Package Manager Console :
Select DBAccess inside Default project picklist
Execute the command :
Add-Migration CreateInitialDatabase -Context MsSqlDbContext for Microsoft SQL Server
Add-Migration CreateInitialDatabase -Context PostgreSqlDbContext for PostgreSQL"

One would need to got to program.cs and comment out await FillInDatabase(); Line 81

Then run in my case - >Add-Migration CreateInitialDatabase -Context MsSqlDbContext
Then run in my case -> Update-Database -Context MsSqlDbContext

After Database is created then go back to Program.cs uncomment await FillInDatabase(); Line 81

Then run the startup project BlogCoreAPI
This will now initiate DbInitializer to pre-populate the database. Swagger will work fine.
So, there is nothing wrong with the code it's, awesome. Just update the wiki.
Thank you for your effort with this.
Do you have an example web application using this API?
Please
Thank you
Dwight

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions