Reputation: 117
I keep getting this error on initial load of my application. I have searched high and low and the only thing I found to do was the code below in my context.
Database.SetInitializer<Context>(null);
I have this set in the OnModelCreating method but it is still throwing the error below:
System.Data.SqlClient.SqlException: Invalid object name 'dbo.EdmMetadata'. System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details.
Upvotes: 4
Views: 3048
Reputation: 1976
You should add this code in constructor of your Context
class.
Upvotes: 5