Change ModelBuilder to ConventionModelBuilder

This commit is contained in:
ajcvickers 2014-08-15 08:45:28 -07:00
parent cb9184e1c0
commit e2736173e8
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ namespace MusicStore.Models
public DbSet<CartItem> CartItems { get; set; }
public DbSet<OrderDetail> OrderDetails { get; set; }
protected override void OnModelCreating(ModelBuilder builder)
protected override void OnModelCreating(ConventionModelBuilder builder)
{
// TODO: All this configuration needs to be done manually right now.
// We can remove this once EF supports the conventions again.

View File

@ -24,7 +24,7 @@ namespace MusicStore.Models
public DbSet<CartItem> CartItems { get; set; }
public DbSet<OrderDetail> OrderDetails { get; set; }
protected override void OnModelCreating(ModelBuilder builder)
protected override void OnModelCreating(ConventionModelBuilder builder)
{
builder.Entity<Album>().Key(a => a.AlbumId);
builder.Entity<Artist>().Key(a => a.ArtistId);