Change ModelBuilder to ConventionModelBuilder
This commit is contained in:
parent
cb9184e1c0
commit
e2736173e8
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue