Using auto generated id for albums
This commit is contained in:
parent
7470e3cb28
commit
302f5a00fa
|
|
@ -567,11 +567,8 @@ namespace MusicStore.Models
|
||||||
new Album { Title = "Zoso", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl },
|
new Album { Title = "Zoso", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl },
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO [EF] Swap to store generated keys when available
|
|
||||||
int albumId = 1;
|
|
||||||
foreach (var album in albums)
|
foreach (var album in albums)
|
||||||
{
|
{
|
||||||
album.AlbumId = albumId++;
|
|
||||||
album.ArtistId = album.Artist.ArtistId;
|
album.ArtistId = album.Artist.ArtistId;
|
||||||
album.GenreId = album.Genre.GenreId;
|
album.GenreId = album.Genre.GenreId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue