实验环境是VS 2015.MSSQL Server 2008.windows 10 一.创建项目 通过VS创建一个MVC5项目EntityFrameworkExtension 二.安装Entity Framework 通过nuget添加Entity Framework到项目,当前版本为6.2.0 三.创建实体类Student public class Student { public string Id { get; set; } public string Name { get; set; }…
1.CreateDatabaseIfNotExists: 2.DropCreateDatabaseIfModelChanges: 3.DropCreateDatabaseAlways: 4.Custom DB Initializer: public class SchoolDBContext: DbContext { public SchoolDBContext(): base("SchoolDBConnectionString") { Database.SetInitializer&…