Exemple #1
0
        /// <summary>
        /// Appends the subquery.
        /// </summary>
        /// <param name="key">The attribute key.</param>
        /// <param name="value">The attribute value.</param>
        /// <param name="matchVariant">The match variant.</param>
        public void AppendAttribute(string key, string value, MatchVariant matchVariant)
        {
            AttributeQuery query = new AttributeQuery(key, value, matchVariant);
            QueryNode      node  = new QueryNode(query);

            this.AddNode(node);
        }
    /// <summary>
    /// Builds the attribute sub query.
    /// </summary>
    /// <param name="subQuery">The subquery.</param>
    /// <returns>The subquery</returns>
    protected override string BuildAttributeSubQuery(AttributeQuery subQuery)
    {
      string matchVariant = this.GetMatchVariant(subQuery.MatchVariant);
      if (string.IsNullOrEmpty(matchVariant) && MatchVariant.Like == subQuery.MatchVariant)
      {
        return string.Format("contains(@@{0}, '{1}')", subQuery.Key, subQuery.Value);
      }

      return string.Format("@@{0} {2} '{1}'", subQuery.Key, subQuery.Value, matchVariant);
    }
    /// <summary>
    /// Builds the attribute sub query.
    /// </summary>
    /// <param name="subQuery">The subquery.</param>
    /// <returns>The subquery</returns>
    protected override string BuildAttributeSubQuery(AttributeQuery subQuery)
    {
      string variant = this.GetMatchVariant(subQuery.MatchVariant);
      if (string.IsNullOrEmpty(variant) && subQuery.MatchVariant == MatchVariant.Like)
      {
        return string.Format("@@{0} = '{2}{1}{2}'", subQuery.Key, this.EscapeSpecialCharacters(subQuery.Value), "%");
      }

      return string.Format("@@{0} {2} '{1}'", subQuery.Key, subQuery.Value, variant);
    }
Exemple #4
0
        /// <summary>
        /// Builds the attribute sub query.
        /// </summary>
        /// <param name="subQuery">The subquery.</param>
        /// <returns>The subquery</returns>
        protected override string BuildAttributeSubQuery(AttributeQuery subQuery)
        {
            string matchVariant = this.GetMatchVariant(subQuery.MatchVariant);

            if (string.IsNullOrEmpty(matchVariant) && MatchVariant.Like == subQuery.MatchVariant)
            {
                return(string.Format("contains(@@{0}, '{1}')", subQuery.Key, subQuery.Value));
            }

            return(string.Format("@@{0} {2} '{1}'", subQuery.Key, subQuery.Value, matchVariant));
        }
Exemple #5
0
        /// <summary>
        /// Builds the attribute sub query.
        /// </summary>
        /// <param name="subQuery">The subquery.</param>
        /// <returns>The subquery</returns>
        protected override string BuildAttributeSubQuery(AttributeQuery subQuery)
        {
            string variant = this.GetMatchVariant(subQuery.MatchVariant);

            if (string.IsNullOrEmpty(variant) && subQuery.MatchVariant == MatchVariant.Like)
            {
                return(string.Format("@@{0} = '{2}{1}{2}'", subQuery.Key, this.EscapeSpecialCharacters(subQuery.Value), "%"));
            }

            return(string.Format("@@{0} {2} '{1}'", subQuery.Key, subQuery.Value, variant));
        }
Exemple #6
0
 /// <summary>
 /// Appends the subquery.
 /// </summary>
 /// <param name="key">The attribute key.</param>
 /// <param name="value">The attribute value.</param>
 /// <param name="matchVariant">The match variant.</param>
 public void AppendAttribute(string key, string value, MatchVariant matchVariant)
 {
   AttributeQuery query = new AttributeQuery(key, value, matchVariant);
   QueryNode node = new QueryNode(query);
   this.AddNode(node);
 }
Exemple #7
0
 /// <summary>
 /// Determines whether [contains] [the specified query].
 /// </summary>
 /// <param name="query">The query.</param>
 /// <returns>
 /// <c>true</c> if [contains] [the specified query]; otherwise, <c>false</c>.
 /// </returns>
 public bool Contains(AttributeQuery query)
 {
   return this.Contains(this.FirstNode, query);
 }
Exemple #8
0
 /// <summary>
 /// Adds the specified atr query.
 /// </summary>
 /// <param name="atrQuery">The atribute query.</param>
 public void Add(AttributeQuery atrQuery)
 {
   this.AddNode(new QueryNode(atrQuery));
 }
Exemple #9
0
 /// <summary>
 /// Determines whether [contains] [the specified query].
 /// </summary>
 /// <param name="query">The query.</param>
 /// <returns>
 /// <c>true</c> if [contains] [the specified query]; otherwise, <c>false</c>.
 /// </returns>
 public bool Contains(AttributeQuery query)
 {
     return(this.Contains(this.FirstNode, query));
 }
Exemple #10
0
 /// <summary>
 /// Adds the specified atr query.
 /// </summary>
 /// <param name="atrQuery">The atribute query.</param>
 public void Add(AttributeQuery atrQuery)
 {
     this.AddNode(new QueryNode(atrQuery));
 }
 /// <summary>
 /// Builds the attribute sub query.
 /// </summary>    
 /// <param name="subQuery">The subquery.</param>
 /// <returns>The subquery</returns>
 protected abstract string BuildAttributeSubQuery(AttributeQuery subQuery);
 /// <summary>
 /// Builds the attribute sub query.
 /// </summary>
 /// <param name="subQuery">The subquery.</param>
 /// <returns>The subquery</returns>
 protected abstract string BuildAttributeSubQuery(AttributeQuery subQuery);