Skip to content

Instantly share code, notes, and snippets.

@mmilleruva
Created October 30, 2013 19:00
Show Gist options
  • Save mmilleruva/7238133 to your computer and use it in GitHub Desktop.
Save mmilleruva/7238133 to your computer and use it in GitHub Desktop.
public partial class ToyContext : DbContext
{
static ToyContext()
{
Database.SetInitializer(null);
{
public ToyContext()
: base("Name=ToyContext"){}
public DbSet Orders { get; set; }
public DbSet Person { get; set; }
public DbSet Preferences { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Configurations.Add(new OrderMap());
modelBuilder.Configurations.Add(new PersonMap());
modelBuilder.Configurations.Add(new PreferenceMap());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment