Reacting to Changes in EF: Disabling use of Identity Column for PK
This commit is contained in:
parent
5004bac6aa
commit
117dbc4887
|
|
@ -26,8 +26,8 @@ namespace MusicStore.Models
|
||||||
builder.Entity<OrderDetail>().Key(o => o.OrderDetailId);
|
builder.Entity<OrderDetail>().Key(o => o.OrderDetailId);
|
||||||
|
|
||||||
// TODO: Remove this when we start using auto generated values
|
// TODO: Remove this when we start using auto generated values
|
||||||
builder.Entity<Artist>().Property(a => a.ArtistId).GenerateValueOnAdd(generateValue: false);
|
builder.Entity<Artist>().Property(a => a.ArtistId).GenerateValueOnAdd(generateValue: false).ForSqlServer(b => b.UseNoValueGeneration());
|
||||||
builder.Entity<Genre>().Property(g => g.GenreId).GenerateValueOnAdd(generateValue: false);
|
builder.Entity<Genre>().Property(g => g.GenreId).GenerateValueOnAdd(generateValue: false).ForSqlServer(b => b.UseNoValueGeneration());
|
||||||
|
|
||||||
//Deleting an album fails with this relation
|
//Deleting an album fails with this relation
|
||||||
builder.Entity<Album>().Ignore(a => a.OrderDetails);
|
builder.Entity<Album>().Ignore(a => a.OrderDetails);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue