Пример #1
0
        public void AddToPage(string url, List<ContentModel> model)
        {
            var contentComponent = new ContentComponent(Context);
            var pageComponent = new PageService(Context);

            var page = pageComponent.GetPage(Context.Root, url);

            if (page == null)
            {
                throw new Exception("Page does not exist!");
            }

            contentComponent.DeleteContent(page);

            foreach (var content in model)
            {
                var contentTree = GetContentTreeFromModel(content);

                contentComponent.AddContent(page, contentTree);
            }
        }
Пример #2
0
 public void AddContentToPage(Entities.Page page, Entities.Content content)
 {
     var component = new ContentComponent(Context);
     component.AddContent(page, content);
 }