Esempio n. 1
0
        public async Task <List <GetSongResponse> > GetAsync(int count)
        {
            List <Song> songs = new List <Song>();

            for (int i = 0; i < count; i++)
            {
                songs.Add(await _repo.GetAsync());
            }

            return(_mapper.Map <List <GetSongResponse> >(songs));
        }
Esempio n. 2
0
        public async Task RemoveAsync(Guid songId, Guid playlistId)
        {
            var song = await _songRepository.GetAsync(songId, playlistId);

            if (song == null)
            {
                throw new ArgumentException($"Song with playlist id: {playlistId} or song id: {songId}, doest not exists");
            }

            await _songRepository.RemoveAsync(song);
        }