Fixing the test failure

On introducing a FK relationship from OrderDetails table to Album table with album id creates a problem when deleting an album that's checked out atleast once.
This commit is contained in:
Praburaj 2014-12-02 11:29:49 -08:00
parent e21f6052f2
commit 65f58b98a8
1 changed files with 3 additions and 1 deletions

View File

@ -33,7 +33,9 @@ namespace MusicStore.Models
builder.Entity<Album>().ManyToOne(a => a.Artist);
builder.Entity<Album>().ManyToOne(a => a.Genre, g => g.Albums);
builder.Entity<Order>().OneToMany(o => o.OrderDetails);
builder.Entity<Album>().OneToMany(a => a.OrderDetails, od => od.Album);
//Deleting an album fails with this relation
//builder.Entity<Album>().OneToMany(a => a.OrderDetails, od => od.Album);
base.OnModelCreating(builder);
}