Ejemplo n.º 1
0
        // PUBLIC METHODS ///////////////////////////////////////////////////
        #region Factory Methods
        public static DomReadOnlyRelationship Create(string rel, Relationship relationship)
        {
            Contract.Requires(String.IsNullOrWhiteSpace(rel) == false);
            Contract.Requires(relationship != null);

            var domReadOnlyRelationship = new DomReadOnlyRelationship(rel, relationship);

            return(domReadOnlyRelationship);
        }
        // INTERNAL METHODS /////////////////////////////////////////////////
        #region Builder Methods
        internal DomReadOnlyRelationship AddDomReadOnlyRelationship(string rel, Relationship relationship)
        {
            Contract.Requires(String.IsNullOrWhiteSpace(rel) == false);
            Contract.Requires(relationship != null);

            this.ValidateRelationshipDoesNotExist(rel);

            var domReadOnlyRelationship = this.CreateAndAddNode(() => DomReadOnlyRelationship.Create(rel, relationship));

            return(domReadOnlyRelationship);
        }
Ejemplo n.º 3
0
        public static DomReadOnlyRelationship Create(string rel, IGetRelationships getRelationships)
        {
            Contract.Requires(String.IsNullOrWhiteSpace(rel) == false);
            Contract.Requires(getRelationships != null && getRelationships.Relationships != null);

            var relationship = getRelationships.GetRelationship(rel);

            var domReadOnlyRelationship = new DomReadOnlyRelationship(rel, relationship);

            return(domReadOnlyRelationship);
        }