public async Task <IActionResult> DeleteByYouTubeId([FromBody] EditYoutube youTube) { //Console.WriteLine("youTube.youTubeId"); //Console.WriteLine(youTube.youTubeId); await _songRepository.DeleteByYouTubeId(youTube.youTubeId); await _movieRepository.DeleteByYouTubeId(youTube.youTubeId); return(Json(youTube.youTubeId)); }
public async Task <IActionResult> EditYoutube([FromBody] EditYoutube editYoutube) { //Debug.Print("EDITSONG"); if (editYoutube.newYouTubeId != editYoutube.youTubeId) { await _songRepository.ChangeYouTubeId(editYoutube.name, editYoutube.youTubeId, editYoutube.newYouTubeId); await _movieRepository.ChangeYouTubeId(editYoutube.name, editYoutube.newYouTubeId); } if (editYoutube.newName != editYoutube.name) { await _songRepository.ChangeName(editYoutube.youTubeId, editYoutube.newName); await _movieRepository.ChangeName(editYoutube.youTubeId, editYoutube.newName); } return(Json(editYoutube)); }