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")); }
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")); }
public void DeleteSlide(short slideId, int presentationId) { _slideRepository.DeleteSlide(slideId, presentationId); }