Ejemplo n.º 1
0
 /// <summary>
 /// Adds the elements of another SqlConstantCollection to the end of this SqlConstantCollection.
 /// </summary>
 /// <param name="items">
 /// The SqlConstantCollection whose elements are to be added to the end of this SqlConstantCollection.
 /// </param>
 public virtual void AddRange(SqlConstantCollection items)
 {
     foreach (SqlConstant item in items)
     {
         this.List.Add(item);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a SqlConstantCollection from a list of values.
        /// </summary>
        /// <remarks>
        /// The type of SqlConstant items in the collection is determined automatically.
        /// See <see cref="Add"/> method for more info.
        /// </remarks>
        /// <param name="values"></param>
        /// <returns></returns>
        public static SqlConstantCollection FromList(IList values)
        {
            SqlConstantCollection collection = new SqlConstantCollection(values.Count);

            foreach (object val in values)
            {
                collection.Add(val);
            }
            return(collection);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a WhereTerm which represents SQL IN clause
        /// </summary>
        /// <param name="expr">Expression to be looked up</param>
        /// <param name="values">List of values</param>
        /// <returns></returns>
        public static WhereTerm CreateIn(SqlExpression expr, SqlConstantCollection values)
        {
            WhereTerm term = new WhereTerm();

            term.expr1  = expr;
            term.values = values;

            term.type = WhereTermType.In;

            return(term);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the SqlConstantCollection class, containing elements
 /// copied from another instance of SqlConstantCollection
 /// </summary>
 /// <param name="items">
 /// The SqlConstantCollection whose elements are to be added to the new SqlConstantCollection.
 /// </param>
 public SqlConstantCollection(SqlConstantCollection items)
 {
     this.AddRange(items);
 }
Ejemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="collection"></param>
 public Enumerator(SqlConstantCollection collection)
 {
     this.wrapped = ((System.Collections.CollectionBase)collection).GetEnumerator();
 }