public async Task DeleteMusicFromPlaylistAsync(MusicPlaylistDTO musicPlaylistDTO)
        {
            var musicPlaylist = await unitOfWork
                                .MusicPlaylistRepository
                                .GetByUserPlaylistIdAndMusicId(
                musicPlaylistDTO.UserPlaylistId,
                musicPlaylistDTO.MusicId);

            await unitOfWork.MusicPlaylistRepository.Delete(musicPlaylist);
        }
        public async Task <ActionResult> DeleteMusicFromPlaylist([FromBody] MusicPlaylistDTO musicPlaylistDTO)
        {
            if (musicPlaylistDTO == null)
            {
                return(BadRequest());
            }
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            await playlistService.DeleteMusicFromPlaylistAsync(musicPlaylistDTO);

            return(NoContent());
        }
        public async Task <ActionResult> PostMusicToPlaylist([FromBody] MusicPlaylistDTO musicPlaylistDTO)
        {
            if (musicPlaylistDTO == null)
            {
                BadRequest();
            }
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            await playlistService.AddMusicToPlaylistAsync(musicPlaylistDTO);

            return(Ok(musicPlaylistDTO));
        }
 public async Task AddMusicToPlaylistAsync(MusicPlaylistDTO musicPlaylistDTO)
 {
     var musicPlaylist = mapper.Map <MusicPlaylist>(musicPlaylistDTO);
     await unitOfWork.MusicPlaylistRepository.Add(musicPlaylist);
 }