/* public bool UpdateSongsInPlayList(UpdateSongInPlayListRequest request) * { * if (request != null) * { * var playList = _db.UsersPlayLists.Where(a => a.Id == request.Id).FirstOrDefault(); * if (playList != null) * { * playList.SongName = string.IsNullOrEmpty(request.SongName) ? playList.SongName : request.SongName; * * _db.SaveChanges(); * * return true; * * } * return false; * } * return false; * }*/ public bool DeleteSongsFromPlayList(DeletePlayListRequest request) { if (request != null) { UsersPlayList songList = new UsersPlayList(); songList = _db.UsersPlayLists.Where(a => a.SongId == request.songId && a.PlayListId == request.PlayListId && a.UserId == request.UserId).FirstOrDefault(); _db.UsersPlayLists.Remove(songList); _db.SaveChanges(); return(true); } return(false); }
public IActionResult DeleteSongsFromPlayList(DeletePlayListRequest data) { return(Ok(repository.DeleteSongsFromPlayList(data))); }