Created
October 30, 2013 18:58
-
-
Save mmilleruva/7238100 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 class PersonMap : EntityTypeConfiguration | |
{ | |
public PersonMap() | |
{ | |
// Primary Key | |
this.HasKey(t => t.PersonId); | |
this.ToTable("Person"); | |
// Relationships | |
this.HasMany(t => t.Orders) | |
.WithRequired() | |
.HasForeignKey(t => t.PersonId); | |
this.Ignore(t => t.Preferences); | |
} | |
} | |
public class OrderMap : EntityTypeConfiguration | |
{ | |
public OrderMap() | |
{ | |
// Primary Key | |
this.HasKey(t => t.OrderId); | |
} | |
} | |
public class PreferenceMap : EntityTypeConfiguration | |
{ | |
public PreferenceMap() | |
{ | |
// Primary Key | |
this.HasKey(t => t.PreferenceId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment