public static List<Track> GetSampleTracks(int qtyPerAlbum = 8) { var sampleAlbums = GetSampleAlbums(); var sampleTracks = new List<Track>(); int trackIdIndex = 1; foreach (var album in sampleAlbums) { var albumTracks = new List<Track>(); for (int i = 1; i <= qtyPerAlbum; i++) { albumTracks.Add(new Track { TrackId = trackIdIndex, AlbumId = album.AlbumId, Name = "Album " + album.Title + "/Track " + i }); trackIdIndex++; } sampleTracks.AddRange(albumTracks); } return sampleTracks; }
public static List<Album> GetSampleAlbums(int qtyPerArtist = 5) { var sampleArtists = GetSampleArtists(); var sampleAlbums = new List<Album>(); int albumIdIndex = 1; foreach (var artist in sampleArtists) { var artistAlbums = new List<Album>(); for (int i = 1; i <= qtyPerArtist; i++) { artistAlbums.Add(new Album { AlbumId = albumIdIndex, ArtistId = artist.ArtistId, Title = artist.Name + ": Super Awesome Album #" + i }); albumIdIndex++; } sampleAlbums.AddRange(artistAlbums); } return sampleAlbums; }