private APConnection Build()
        {
            APConnection conn = null;

            if (this.EndpointAContent != null && this.EndpointBContent != null)
            {
                conn = new APConnection(this.RelationName, EndpointALabel, EndpointAContent, EndpointBLabel, EndpointBContent);
            }
            else if (this.EndpointAContent == null && this.EndpointBContent != null)
            {
                conn = new APConnection(this.RelationName, EndpointBLabel, EndpointBContent, EndpointALabel, EndpointAId);
            }
            else if (this.EndpointAContent != null && this.EndpointBContent == null)
            {
                conn = new APConnection(this.RelationName, EndpointALabel, EndpointAContent, EndpointBLabel, EndpointBId);
            }
            else
            {
                conn = new APConnection(this.RelationName, EndpointALabel, EndpointAId, EndpointBLabel, EndpointBId);
            }
            return(conn);
        }
 private APConnection Build()
 {
     APConnection conn = null;
     if (this.EndpointAContent != null && this.EndpointBContent != null)
         conn = new APConnection(this.RelationName, EndpointALabel, EndpointAContent, EndpointBLabel, EndpointBContent);
     else if (this.EndpointAContent == null && this.EndpointBContent != null)
         conn = new APConnection(this.RelationName, EndpointBLabel, EndpointBContent, EndpointALabel, EndpointAId);
     else if (this.EndpointAContent != null && this.EndpointBContent == null)
         conn = new APConnection(this.RelationName, EndpointALabel, EndpointAContent, EndpointBLabel, EndpointBId);
     else
         conn = new APConnection(this.RelationName, EndpointALabel, EndpointAId, EndpointBLabel, EndpointBId);
     return conn;
 }
        private APConnection Build()
        {
            APConnection conn = null;
            // Handle object references.
            if (this.EndpointAObjectReference != null && this.EndpointBObjectReference != null)
                return new APConnection(this.RelationName, this.EndpointALabel, this.EndpointAObjectReference, this.EndpointBLabel, this.EndpointBObjectReference);
            if (this.EndpointAObjectReference != null)
            {
                if( this.EndpointBContent != null )
                    return new APConnection(this.RelationName, this.EndpointBLabel, this.EndpointBContent, this.EndpointALabel, this.EndpointAObjectReference);
                else
                    return new APConnection(this.RelationName, this.EndpointBLabel, this.EndpointBId, this.EndpointALabel, this.EndpointAObjectReference);
            }
            if (this.EndpointBObjectReference != null)
            {
                if (this.EndpointAContent != null)
                    return new APConnection(this.RelationName, this.EndpointALabel, this.EndpointAContent, this.EndpointBLabel, this.EndpointBObjectReference);
                else
                    return new APConnection(this.RelationName, this.EndpointALabel, this.EndpointAId, this.EndpointBLabel, this.EndpointBObjectReference);
            }




            
            if (this.EndpointAContent != null && this.EndpointBContent != null)
                conn = new APConnection(this.RelationName, EndpointALabel, EndpointAContent, EndpointBLabel, EndpointBContent);
            else if (this.EndpointAContent == null && this.EndpointBContent != null)
                conn = new APConnection(this.RelationName, EndpointBLabel, EndpointBContent, EndpointALabel, EndpointAId);
            else if (this.EndpointAContent != null && this.EndpointBContent == null)
                conn = new APConnection(this.RelationName, EndpointALabel, EndpointAContent, EndpointBLabel, EndpointBId);
            else
                conn = new APConnection(this.RelationName, EndpointALabel, EndpointAId, EndpointBLabel, EndpointBId);
            conn.Endpoints.EndpointA.ObjectReference = this.EndpointAObjectReference;
            conn.Endpoints.EndpointB.ObjectReference = this.EndpointAObjectReference;
            return conn;
        }