Title: Using 'DropCreateDatabaseWhenModelChanges' error
Tags: asp.net-mvc;database;entity-framework;initializer
Question: When I add this code Database.SetInitializer(new DropCreateDatabaseWhenModelChanges()); in DbContext file, I get the following error:
The type or namespace name 'DropCreateDatabaseWhenModelChanges' could not be found (are you missing a using directive or an assembly reference?)
I have included the System.Data.Entity namespace.  What could I be missing?
I tried with DropCreateDatabaseIfModelChanges, in vain.

Here is the accepted answer: Use Database.SetInitializer(new DropCreateDatabaseIfModelChanges<StudentDbContext&gt;());

Here is another answer: you mean DropCreateDatabaseIfModelChanges not DropCreateDatabaseWhenModelChanges

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2015:00:10/07/15', 'FavoriteCount': 0.0, 'PostTypeId': 1, 'Tags': '<asp.net-mvc><database><entity-framework><initializer>', 'Title': "Using 'DropCreateDatabaseWhenModelChanges' error", 'ViewCount': 223, 'id': 32986564, 'user_AboutMe': '<p>I am a graduate in computer science and am learning how to develop web applications.</p>\n', 'user_AccountId': 6688937.0, 'user_DisplayName': 'refresh', 'user_Reputation': 1277.0, 'user_Views': 303.0, 'user_id': 5159029.0}}