Closed Kevin11Stone closed 4 years ago
Deleting the database does not solve this issue.
Manually creating the table within the migration also did not solve the issue.
After manually creating the table within a migration, re scaffolding a previous migration (modelChanges) by running Update-Database -TargetMigration 202001101945026_InitialDesign, deleting the previous migration and updating the database, the Beverage table was successfully created.
I speculated it was a relationship issue. After adding a primary key property, the same exception is thrown.
Possible solution:
Below is a snippet from the inner exception. System.Data.SqlClient.SqlException: Invalid object name 'dbo.Beverages'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)