private PageDefinition CreateDefinition(PageDefinitionStore pageDefinitionStore, string name) { var def = new PageDefinition(); def.Name = name; var container = new ContentItem { Name = "container", Type = "container"}; var row = new ContentItem { Name = "row1", Type = "row" }; var column = new ContentItem { Name = "col-1", Type = "column" }; row.Items.Add(column); container.Items.Add(row); def.Items.Add(container); pageDefinitionStore.Add(def); return def; }
public void SaveContentTree(Entities.Page page, ContentItem content, Entities.Content parent) { var newParent = new Entities.Content { PageId = page.Id, ParentId = parent?.Id, Name = content.Name, Type = content.Type, Data = content.Data }; SaveContent(newParent); content.Items.ForEach(x=>SaveContentTree(page, x, newParent)); }