public ActionResult Delete(WebPageModel model)
        {
            try
            {
                var page     = _webPageService.GetById(model.Id);
                var sections = _webPageService.GetSectionsByPageId(model.Id);
                foreach (var section in sections)
                {
                    _sectionService.Delete(section);
                }

                _webPageService.Delete(page);

                var urlRecord = _urlRecordService.GetBySlug(page.VirtualPath);
                _urlRecordService.Delete(urlRecord);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Beispiel #2
0
        public IActionResult GetSections(int pageId)
        {
            var entities = _webPageService.GetSectionsByPageId(pageId).ToList();

            return(Ok(entities));
        }