public async Task <IActionResult> Delete(int sectionId, [FromForm] SlideViewModel model)
        {
            var slide = await repo.GetSlideAsync(model.Id);

            repo.DeleteSlide(slide);
            await repo.SaveAsync();

            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public ActionResult Delete(int slideId)
        {
            Slide slide = repository.Sliders.FirstOrDefault(s => s.SlideID == slideId);

            if (slide != null)
            {
                repository.DeleteSlide(slide);
                TempData["message"] = string.Format("{0} was deleted", slide.Title);
            }
            return(RedirectToAction("Index"));
        }
Beispiel #3
0
 public void DeleteSlide(short slideId, int presentationId)
 {
     _slideRepository.DeleteSlide(slideId, presentationId);
 }