Ejemplo n.º 1
0
        public IEnumerable <PlaylistTrackBE> GetPlaylistTracks()
        {
            var ids = Context.PlaylistTrack.Where(p => p.TrackId == Id)
                      .Select(p => new { p.PlaylistId, p.TrackId })
                      .ToList()
                      .Select(p => ((int)p.PlaylistId, (int)p.TrackId));

            foreach (var id in ids)
            {
                var item = new PlaylistTrackBE(CRUDTestDBContextProvider);
                item.Load(id, id.Item1, id.Item2);
                yield return(item);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Return all PlaylistTrackBEs
        /// </summary>
        /// <returns></returns>
        public IEnumerable <PlaylistTrackBE> GetPlaylistTrackBEs()
        {
            using var context = cRUDTestDBContextProvider.GetContext();
            foreach (var id in context.PlaylistTrack
                     .Select(p => new { p.PlaylistId, p.TrackId })
                     .ToList()
                     .Select(p => ((int)p.PlaylistId, (int)p.TrackId)))
            {
                PlaylistTrackBE playlistTrackBE = new PlaylistTrackBE(cRUDTestDBContextProvider);

                playlistTrackBE.Load(id, id.Item1, id.Item2);

                yield return(playlistTrackBE);
            }
        }