/// <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); }
/// <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)); }
/// <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> /// 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); }
/// <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> /// 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)); }
/// <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);