Exemple #1
0
        public async Task <List <PlaylistViewModel> > GetAllPlaylistAsync(CancellationToken ct = default(CancellationToken))
        {
            var playlists = PlaylistCoverter.ConvertList(await _playlistRepository.GetAllAsync(ct));

            foreach (var playlist in playlists)
            {
                playlist.Tracks = await GetTrackByPlaylistIdIdAsync(playlist.PlaylistId, ct);
            }
            return(playlists.ToList());
        }
Exemple #2
0
 public async Task <IActionREsult> Get()
 {
     try
     {
         return(Ok(await _playRepo.GetAllAsync()));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, ex));
     }
 }
Exemple #3
0
 public async Task <IEnumerable <Playlist> > GetAllAsync(int accountId)
 {
     return(await _playlistRepository.GetAllAsync(accountId));
 }