Created
October 19, 2017 00:48
-
-
Save dcomartin/5e8f1e9c10b65cb946d18a8fc946d074 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
class MyContext : DbContext | |
{ | |
public DbSet<Car> Cars { get; set; } | |
protected override void OnModelCreating(ModelBuilder modelBuilder) | |
{ | |
modelBuilder.Entity<Car>() | |
.HasKey(c => new { c.State, c.LicensePlate }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment