public static Element ElementFromDatabase(DbTagsAndAttributes tagsAndAttributes) { var rootElementQuery = from tag in tagsAndAttributes.Tags where tag.ParentId is null select tag; var rootTag = rootElementQuery.First(); // database contains no root element or is empty if (rootTag is null) { return(new Element()); } var helper = new HelperDbTagsAndAttributes(tagsAndAttributes); return(helper.ElementFromDatabaseTag(rootTag)); }
public HelperDbTagsAndAttributes(DbTagsAndAttributes tagsAndAttributes) { TagsAndAttributes = tagsAndAttributes; }
public void UpdateTagsAndAttributes(DbTagsAndAttributes tagsAndAttributes) { UpdateTags(tagsAndAttributes.Tags); UpdateAttributes(tagsAndAttributes.Attributes); }