public static DbTagsAndAttributes DatabaseFromObject(object startingTag) { HelperDbTagsAndAttributes tagsAndAttributes = new HelperDbTagsAndAttributes(); tagsAndAttributes.ParseObject(startingTag); return(tagsAndAttributes.TagsAndAttributes); }
public static DbTagsAndAttributes DatabaseFromElement(Element element) { HelperDbTagsAndAttributes tagsAndAttributes = new HelperDbTagsAndAttributes(); tagsAndAttributes.ParseElement(element); return(tagsAndAttributes.TagsAndAttributes); }
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)); }