//在Code First 这句话的意思是在模型发生改变的时候把数据库删掉然后重建 放在Global.asax文件中System.Data.Entity.Database.SetInitializer(new System.Data.Entity.DropCreateDatabaseIfModelChanges<DbModel.WebEntities>());