Ejemplo n.º 1
0
        public FullPageViewModel Create(FullPageViewModel page)
        {
            var result = new FullPageViewModel();

            var newEntity     = GenericMapper.MapObject <Page>(page);
            var createdEntity = _pagesService.Create(newEntity);

            if (createdEntity != null)
            {
                result = GenericMapper.MapObject <FullPageViewModel>(createdEntity);
            }

            return(result);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Index()
        {
            var page = await _cmsApiProxy.GetPage(_pageId, _regionValue.PagesApiUrl);

            var htmlBody = StringHelper.SanitizeHtml(page.Content?.Rendered, _cmsDomain);

            var model = new FullPageViewModel
            {
                Header   = page.Title.Rendered,
                HtmlBody = htmlBody,
                Ogp      = new OgpViewModel
                {
                    Title       = page.Title.Rendered,
                    Description = page.Title.Rendered,
                    Type        = "website",
                    Url         = Request.GetDisplayUrl()
                }
            };

            return(View(model));
        }
Ejemplo n.º 3
0
        public void Update(int id, FullPageViewModel page)
        {
            var updatedEntity = GenericMapper.MapObject <Page>(page);

            _pagesService.Update(id, updatedEntity);
        }