This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DbContext | |
========= | |
class SchoolDb : DbContext { | |
public DbSet<Class> Classes { get; set; } | |
public DbSet<Person> Persons { get; set; } | |
public SchoolDb() : base("Data Source=(localdb)\\schooldb;Initial Catalog=SchoolDb;Integrated Security=True") { | |
System.Data.Entity.Database.SetInitializer(new SchoolDbInitializer()); | |
} | |
protected override void OnModelCreating(DbModelBuilder modelBuilder) { | |
base.OnModelCreating(modelBuilder); |