// PUBLIC METHODS /////////////////////////////////////////////////// #region Factory Methods public static DomReadWriteLinks Create(params Node <DomNodeType>[] domNodes) { var domReadWriteLinks = new DomReadWriteLinks(domNodes); return(domReadWriteLinks); }
internal DomReadWriteRelationship AddDomReadWriteRelationship(string rel, IEnumerable <string> linkRelCollection, Meta meta = null) { Contract.Requires(String.IsNullOrWhiteSpace(rel) == false); Contract.Requires(linkRelCollection != null); this.ValidateRelationshipDoesNotExist(rel); var domReadWriteRelationship = this.CreateAndAddNode(() => DomReadWriteRelationship.Create(rel)); foreach (var linkRel in linkRelCollection) { var domReadWriteLinks = domReadWriteRelationship.GetOrAddNode(DomNodeType.Links, () => DomReadWriteLinks.Create()); domReadWriteLinks.AddDomReadWriteLink(linkRel); } if (meta == null) { return(domReadWriteRelationship); } domReadWriteRelationship.CreateAndAddNode(() => DomReadOnlyMeta.Create(meta)); return(domReadWriteRelationship); }