/// <summary> /// Creates an XPath filter using the specified query object and object type /// </summary> /// <param name="objectType">The type of object to query</param> /// <param name="query">The IXPathQueryObject that contains the query logic to use in the expression</param> /// <returns>An XPath query string</returns> public static string CreateFilter(string objectType, IXPathQueryObject query) { return(new XPathExpression(objectType, query).ToString()); }
/// <summary> /// Creates a filter that dereferences a matching expression, and returns the resulting values from the referenced attribute /// </summary> /// <param name="searchObjectType">The type of object to query</param> /// <param name="query">The IXPathQueryObject that contains the query logic to use in the expression</param> /// <param name="referenceAttributeName">The name of the attribute used to dereference the expression</param> /// <returns>An XPath query string</returns> public static string CreateDereferenceFilter(string searchObjectType, IXPathQueryObject query, string referenceAttributeName) { XPathDereferencedExpression expression = new XPathDereferencedExpression(searchObjectType, referenceAttributeName, query); return(expression.ToString()); }
/// <summary> /// Initializes a new instance of the XPathDereferencedExpression class /// </summary> /// <param name="objectType">The object type used in the expression</param> /// <param name="dereferenceAttribute">The name of the attribute to dereference</param> /// <param name="query">The query used to build the expression</param> /// <param name="wrapFilterXml">Indicates if the resulting expression should be wrapped in an XML filter element</param> public XPathDereferencedExpression(string objectType, string dereferenceAttribute, IXPathQueryObject query, bool wrapFilterXml) : base(objectType, query, wrapFilterXml) { this.DereferenceAttribute = dereferenceAttribute; ResourceManagementSchema.ValidateObjectTypeName(this.DereferenceAttribute); }
/// <summary> /// Initializes a new instance of the XPathDereferencedExpression class /// </summary> /// <param name="objectType">The object type used in the expression</param> /// <param name="dereferenceAttribute">The name of the attribute to dereference</param> /// <param name="query">The query used to build the expression</param> public XPathDereferencedExpression(string objectType, string dereferenceAttribute, IXPathQueryObject query) : this(objectType, dereferenceAttribute, query, false) { }
/// <summary> /// Initializes a new instance of the XPathExpression class /// </summary> /// <param name="objectType">The type of object to query for</param> /// <param name="query">The query component for this expression</param> /// <param name="wrapFilterXml">Indicates if the resulting expression should be wrapped in a filter XML element</param> public XPathExpression(string objectType, IXPathQueryObject query, bool wrapFilterXml) { this.ObjectType = objectType; this.Query = query; this.WrapFilterXml = wrapFilterXml; }
/// <summary> /// Initializes a new instance of the XPathExpression class /// </summary> /// <param name="objectType">The type of object to query for</param> /// <param name="query">The query component for this expression</param> public XPathExpression(string objectType, IXPathQueryObject query) : this(objectType, query, false) { }