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:
parent
e21f6052f2
commit
65f58b98a8
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue