public ActionResult DeleteConfirmed(int id) { Song song = ss.GetSongById(id); ss.DeleteSong(song); return(RedirectToAction("Index")); }
public ActionResult DeleteSong(int id) { var service = new SongService(); service.DeleteSong(id); TempData["SaveResult"] = "Song has been deleted"; return(RedirectToAction("Index")); }
//public IHttpActionResult Put(SongEditModel model) //{ // if (!ModelState.IsValid) return BadRequest(ModelState); // var songService = new SongService(Guid.Parse(User.Identity.GetUserId())); // var song = songService.GetSongById(model.SongId); // if (song == null) return NotFound(); // return Ok(songService.UpdateSong(model)); //} public IHttpActionResult Delete(int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var songService = new SongService(Guid.Parse(User.Identity.GetUserId())); return(Ok(songService.DeleteSong(id))); }
/// <summary> /// 删除歌曲 /// </summary> /// <param name="songId"></param> /// <returns></returns> public bool DeleteSong(int songId) { return(songservice.DeleteSong(songId)); }
public IActionResult DeleteSong(int SongId) { songService.DeleteSong(SongId); return(Ok()); }
async Task DeleteSong(Song song) { await SongService.DeleteSong(song.Id); await Refresh(); }