Skip to content

Instantly share code, notes, and snippets.

View tuesd4y's full-sized avatar

Chris Stelzmüller tuesd4y

View GitHub Profile
@tuesd4y
tuesd4y / prhsc
Created December 1, 2016 09:07
prhsc
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);