public JsonResult Publish(PublishPageViewModel viewModel)
        {
            if (!ModelState.IsValid)
                return Json(new JsonResponse("Invalid Data", "This is an invalid page"));

            var getPage = _repoWebPage.DbContext.WebPages.FirstOrDefault(pg => pg.Id == viewModel.PageId);
            if (getPage == null)
                return Json(new JsonResponse("Invalid Page!", "Invalid page id."));

            getPage.IsPublished = true;
            _repoWebPage.DbContext.SaveChanges();

            return Json(new JsonResponse((object)null)
            {
                Message = "Page published successfully!",
                Description = "Page has been published successfully!",
                Content =
                new
                {
                    TreeView = RenderPartialViewToString("PagesTreeView", new PagesTreeView { CurrentPages = _repoWebPage.GetAllPages() })
                }
            });
        }
        public JsonResult Publish(int pageId)
        {
            var getPage = _repoWebPage.DbContext.WebPages.FirstOrDefault(pg => pg.Id == pageId);
            if (getPage == null)
                return Json(new JsonResponse("Invalid Page!", "Invalid page id."));

            var viewModel = new PublishPageViewModel
            {
                PageId = getPage.Id,
                Title = getPage.Title
            };

            var viewDelete = RenderPartialViewToString("Publish", viewModel);
            return Json(new JsonResponse((object)viewDelete), JsonRequestBehavior.AllowGet);
        }