コード例 #1
0
        public ActionResult DeleteAudio(int idBook, int idAudioBook)
        {
            AudioBook audio = _audioBookService.GetAudioBookByID_Service(idBook, idAudioBook);

            _audioBookService.Delete(audio);
            //_audioBookService.Save();
            System.IO.File.Delete(Server.MapPath(audio.FileAudioPath));
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public IActionResult Delete(Guid id)
        {
            try
            {
                _audioBookService.Delete(id);
            }
            catch (Exception e)
            {
                return(NotFound());
            }

            return(Ok());
        }