Beispiel #1
0
        static void DeleteMangaCascade(string mangaTitle)
        {
            var mangaToDelet = mangaRepository.Query(m => m.Name == mangaTitle).First();

            mangaRepository.Delete(mangaToDelet);
            var chaptersTodelete = chapterRepository.Query(c => c.MangaId == mangaToDelet.Id);

            foreach (var chapterToDelete in chaptersTodelete)
            {
                chapterRepository.Delete(chapterToDelete.Id);
                var pagesToDelete = pageRepository.Query(p => p.ChapterId == chapterToDelete.Id);
                foreach (var pageTodelete in pagesToDelete)
                {
                    pageRepository.Delete(pageTodelete.Id);
                }
            }
        }
Beispiel #2
0
        public ActionResult Delete(Page page)
        {
            pagerRepository.Delete(page);
            if (UnitOfWork.Save() != 1)
            {
                return(Content("{success:false}"));
            }

            return(Content("{success:true}"));
        }
Beispiel #3
0
        public ActionResult Delete(int id)
        {
            var efPage = _pageRepo.FindBy(i => i.Id == id).SingleOrDefault();

            if (efPage != null)
            {
                _pageRepo.Delete(efPage.Id);
            }

            return(RedirectToAction("AdminIndex"));
        }
Beispiel #4
0
 public ResponseModel Delete(Page page)
 {
     return(_pageRepository.Delete(page));
 }