diff --git a/src/MusicStore/Models/MusicStoreContext.cs b/src/MusicStore/Models/MusicStoreContext.cs index 72822703bd..a35964f43b 100644 --- a/src/MusicStore/Models/MusicStoreContext.cs +++ b/src/MusicStore/Models/MusicStoreContext.cs @@ -25,9 +25,9 @@ namespace MusicStore.Models builder.Entity().Key(c => c.CartItemId); builder.Entity().Key(o => o.OrderDetailId); - // TODO: Remove this when we start using auto generated values - builder.Entity().Property(a => a.ArtistId).GenerateValueOnAdd(generateValue: false).ForSqlServer(b => b.UseNoValueGeneration()); - builder.Entity().Property(g => g.GenreId).GenerateValueOnAdd(generateValue: false).ForSqlServer(b => b.UseNoValueGeneration()); + // TODO: Remove UseSequence when explicit values insertion removed. Auto generated values enabled. Default is Identity, using sequence at present to allow explicit value insertion. + builder.Entity().Property(a => a.ArtistId).ForSqlServer(b => b.UseSequence()); + builder.Entity().Property(g => g.GenreId).ForSqlServer(b => b.UseSequence()); //Deleting an album fails with this relation builder.Entity().Ignore(a => a.OrderDetails);