Created
October 30, 2013 19:07
-
-
Save mmilleruva/7238251 to your computer and use it in GitHub Desktop.
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
public partial class OrdersContext : DbContext | |
{ | |
static OrdersContext() | |
{ | |
Database.SetInitializer<OrdersContext>(null); | |
} | |
public OrdersContext() | |
: base("Name=ToyContext") | |
{ | |
} | |
public DbSet<Order> Orders { get; set; } | |
public DbSet<Person> Person { get; set; } | |
protected override void OnModelCreating(DbModelBuilder modelBuilder) | |
{ | |
modelBuilder.Configurations.Add(new OrderMap()); | |
modelBuilder.Configurations.Add(new PersonWithOrderMap()); | |
} | |
} | |
public partial class PreferencesContext : DbContext | |
{ | |
static PreferencesContext() | |
{ | |
Database.SetInitializer<PreferencesContext>(null); | |
} | |
public PreferencesContext() | |
: base("Name=ToyContext") | |
{ | |
} | |
public DbSet<Person> Person { get; set; } | |
public DbSet<Preference> Preferences { get; set; } | |
protected override void OnModelCreating(DbModelBuilder modelBuilder) | |
{ | |
modelBuilder.Configurations.Add(new PersonWithPreferenceMap()); | |
modelBuilder.Configurations.Add(new PreferenceMap()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment