Is there a way DropCreateDatabaseIfModelChanges can be applied to all models in the Application_Start of Global.asax instead of using it for each model like this.
Database.SetInitializer<MovieDBContext>(new MovieInitializer());
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No. If you have multiple types context accessing the same database the “trick” is to create one special context which will include all your models and use it only for database initialization.