I want to create a database using code first. And my database is always in "DropCreateDatabaseAlways" mode.
I notice that if I am not trying to execute any database query, for example
using (var db = new Models.TnHContext()) { var query = from u in db.Users select u; foreach (var u in query) { txt += u.UserID + "<br/>"; } }
the database will not be created. If I did not complete it, only I can see the created database. I wonder if this is due to the EntityFramework construct / default behavior?
source share