/// <summary> /// Adds the elements of an array to the end of this ParameterCollection. /// </summary> /// <param name="items"> /// The array whose elements are to be added to the end of this ParameterCollection. /// </param> public virtual void AddRange(Parameter[] items) { foreach (Parameter item in items) { List.Add(item); } }
private void AppendLikeExpression(string[] words, SelectQuery selectQuery, WhereClause group, string columnName) { foreach (string word in words) { if (word.Length == 0) { continue; } var parameter = new Parameter("%" + word + "%"); group.Terms.Add( WhereTerm.CreateCompare(SqlExpression.Field(columnName, selectQuery.FromClause.BaseTable), SqlExpression.Parameter(), CompareOperator.Like)); selectQuery.Parameters.Add(parameter); } }
/// <summary> /// Determines whether a specfic Parameter value is in this ParameterCollection. /// </summary> /// <param name="value"> /// The Parameter value to locate in this ParameterCollection. /// </param> /// <returns> /// true if value is found in this ParameterCollection; /// false otherwise. /// </returns> public virtual bool Contains(Parameter value) { return List.Contains(value); }
/// <summary> /// Adds an instance of type Parameter to the end of this ParameterCollection. /// </summary> /// <param name="value"> /// The Parameter to be added to the end of this ParameterCollection. /// </param> public virtual void Add(Parameter value) { List.Add(value); }
/// <summary> /// Initializes a new instance of the ParameterCollection class, containing elements /// copied from an array. /// </summary> /// <param name="items"> /// The array whose elements are to be added to the new ParameterCollection. /// </param> public ParameterCollection(Parameter[] items) { AddRange(items); }
/// <summary> /// Removes the first occurrence of a specific Parameter from this ParameterCollection. /// </summary> /// <param name="value"> /// The Parameter value to remove from this ParameterCollection. /// </param> public virtual void Remove(Parameter value) { List.Remove(value); }
/// <summary> /// Inserts an element into the ParameterCollection at the specified index /// </summary> /// <param name="index"> /// The index at which the Parameter is to be inserted. /// </param> /// <param name="value"> /// The Parameter to insert. /// </param> public virtual void Insert(int index, Parameter value) { List.Insert(index, value); }
/// <summary> /// Return the zero-based index of the first occurrence of a specific value /// in this ParameterCollection /// </summary> /// <param name="value"> /// The Parameter value to locate in the ParameterCollection. /// </param> /// <returns> /// The zero-based index of the first occurrence of the _ELEMENT value if found; /// -1 otherwise. /// </returns> public virtual int IndexOf(Parameter value) { return List.IndexOf(value); }
public void AddCompare(Enum column, Parameter parameter, CompareOperator compareOperator) { WherePhrase.Terms.Add(WhereTerm.CreateCompare(SqlExpression.Field(column, fromClause.BaseTable), compareOperator == CompareOperator.Like ? SqlExpression.LikeExpressionParameter() : SqlExpression.Parameter(), compareOperator)); Parameters.Add(parameter); }