Пример #1
0
        /// <summary>
        /// Creates an XPath filter for the specified object type and attribute value pair
        /// </summary>
        /// <param name="objectType">The object type to query</param>
        /// <param name="attributeName">The name of the attribute to query</param>
        /// <param name="comparisonOperator">The operator used to compare the attribute and value</param>
        /// <param name="attributeValue">The value of the attribute to query</param>
        /// <returns>An XPath query string</returns>
        public static string CreateFilter(string objectType, string attributeName, ComparisonOperator comparisonOperator, object attributeValue)
        {
            AttributeValuePairCollection dictionary = new AttributeValuePairCollection();

            dictionary.Add(attributeName, attributeValue);
            return(XPathFilterBuilder.CreateFilter(objectType, dictionary, comparisonOperator, GroupOperator.And));
        }
Пример #2
0
        /// <summary>
        /// Creates a filter using the specified query objects
        /// </summary>
        /// <param name="objectType">The object type to query</param>
        /// <param name="queryOperator">The operator used to compare the query elements</param>
        /// <param name="queries">The query elements</param>
        /// <returns>An XPath query string</returns>
        internal static string CreateFilter(string objectType, GroupOperator queryOperator, IEnumerable <IXPathQueryObject> queries)
        {
            XPathQueryGroup group = new XPathQueryGroup(queryOperator, queries);

            group.GroupOperator = queryOperator;
            return(XPathFilterBuilder.CreateFilter(objectType, group));
        }
Пример #3
0
        /// <summary>
        /// Creates a filter that dereferences a matching expression, and returns the resulting values from the referenced attribute
        /// </summary>
        /// <param name="searchObjectType">The object type to query</param>
        /// <param name="searchAttributeName">The name of the attribute to query</param>
        /// <param name="searchAttributeValue">The value of the attribute to query</param>
        /// <param name="referenceAttributeName">The name of the attribute to dereference</param>
        /// <returns>An XPath query string</returns>
        public static string CreateDereferenceFilter(string searchObjectType, string searchAttributeName, object searchAttributeValue, string referenceAttributeName)
        {
            XPathQuery predicate = new XPathQuery(searchAttributeName, ComparisonOperator.Equals, searchAttributeValue);

            return(XPathFilterBuilder.CreateDereferenceFilter(searchObjectType, predicate, referenceAttributeName));
        }
Пример #4
0
 /// <summary>
 /// Creates an XPath filter for the specified object type and attribute/value pairs. Multiple pairs are joined with an 'and' operator
 /// </summary>
 /// <param name="objectType">The object type to query</param>
 /// <param name="keyValuePairs">The list to attribute and value pairs to query for</param>
 /// <param name="valueComparisonOperator">The operator used to compare the attribute and value pairs</param>
 /// <param name="groupOperator">The operator to use to join the attribute value pair comparisons together</param>
 /// <returns>An XPath query string</returns>
 public static string CreateFilter(string objectType, AttributeValuePairCollection keyValuePairs, ComparisonOperator valueComparisonOperator, GroupOperator groupOperator)
 {
     return(XPathFilterBuilder.CreateFilter(objectType, new XPathQueryGroup(groupOperator, keyValuePairs, valueComparisonOperator)));
 }
Пример #5
0
 /// <summary>
 /// Creates a filter using the specified query objects
 /// </summary>
 /// <param name="objectType">The object type to query</param>
 /// <param name="queryOperator">The operator used to compare the query elements</param>
 /// <param name="queries">The query elements</param>
 /// <returns>An XPath query string</returns>
 internal static string CreateFilter(string objectType, GroupOperator queryOperator, params IXPathQueryObject[] queries)
 {
     return(XPathFilterBuilder.CreateFilter(objectType, queryOperator, (IEnumerable <IXPathQueryObject>)queries));
 }
Пример #6
0
        /// <summary>
        /// Creates a filter that dereferences a matching expression, and returns the resulting values from the referenced attribute
        /// </summary>
        /// <param name="searchObjectType">The object type to query</param>
        /// <param name="keyValuePairs">The list to attribute and value pairs to query for</param>
        /// <param name="valueComparisonOperator">The operator used to compare the attribute and value pairs</param>
        /// <param name="groupOperator">The operator to use to join the attribute value pair comparisons together</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, Dictionary <string, object> keyValuePairs, ComparisonOperator valueComparisonOperator, GroupOperator groupOperator, string referenceAttributeName)
        {
            XPathQueryGroup predicate = new XPathQueryGroup(groupOperator, keyValuePairs, valueComparisonOperator);

            return(XPathFilterBuilder.CreateDereferenceFilter(searchObjectType, predicate, referenceAttributeName));
        }