I have been following the ASP.Net Movie Database Tutorial, and it was all going well.
I have just changed the model and added an attribute. Call me curious, but I didn’t want to follow the guide of just drop the database – I wanted to see if I can modify.
The correct error came up about a mismatch – which was expected.
I added the ratings column to the database, and everything worked.
Next, I deleted the ratings column as I wanted to follow the tutorial and learn about DropCreateDatabaseIfModelChanges – however, I just get the error Invalid column name 'Ratings'.
In all this time, the ModelHash entry has not changed, and I have no idea how it know there is a difference between now or before.
So – 1) Have I screwed something up?
2) How can I fix?
3) How did it know before that something has changed, but not now when the hash hasn’t changed?
4) Is there any additional advice you can give?
I think you description must be incorrect because correct behavior will throw the exception despite of manually added
Ratingcolumn.This behavior works as follows:
EdmMetadatais added.EdmMetadatacontains two columns –IdandModelHash.Adding manually
Ratingcolumn will not change stored hash but hash of the model will be different.This behavior can be completely removed by removing
IncludeMetadataConventionconvention: