예제 #1
0
        /// <summary>
        /// Renders a single ORDER BY term
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="term"></param>
        protected virtual void OrderByTerm(StringBuilder builder, OrderByTerm term)
        {
            string dir = (term.Direction == OrderByDirection.Descending) ? "desc" : "asc";

            QualifiedIdentifier(builder, term.TableAlias, term.Field);
            builder.AppendFormat(" {0}", dir);
        }
예제 #2
0
        /// <summary>
        /// Renders ORDER BY terms
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="orderByTerms"></param>
        protected virtual void OrderByTerms(StringBuilder builder, OrderByTermCollection orderByTerms)
        {
            for (int i = 0; i < orderByTerms.Count; i++)
            {
                OrderByTerm term = (OrderByTerm)orderByTerms[i];
                if (i > 0)
                {
                    builder.Append(", ");
                }

                OrderByTerm(builder, term);
            }
        }
예제 #3
0
        /// <summary>
        /// Renders a single ORDER BY term
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="term"></param>
        protected override void OrderByTerm(StringBuilder builder, OrderByTerm term)
        {
            string dir = (term.Direction == OrderByDirection.Descending) ? "desc nulls last" : "asc nulls last";

            if (term.Exp != null)
            {
                Expression(builder, term.Exp);
            }
            else
            {
                QualifiedIdentifier(builder, term.TableAlias, term.Field);
            }
            builder.AppendFormat(" {0}", dir);
        }
예제 #4
0
		/// <summary>
		/// Renders a single ORDER BY term
		/// </summary>
		/// <param name="builder"></param>
		/// <param name="term"></param>
		protected virtual void OrderByTerm(StringBuilder builder, OrderByTerm term)
		{
			string dir = (term.Direction == OrderByDirection.Descending) ? "desc" : "asc";
			QualifiedIdentifier(builder, term.TableAlias, term.Field);
			builder.AppendFormat(" {0}", dir);
		}
예제 #5
0
 /// <summary>
 /// Adds an instance of type OrderByTerm to the end of this OrderByTermCollection.
 /// </summary>
 /// <param name="value">
 /// The OrderByTerm to be added to the end of this OrderByTermCollection.
 /// </param>
 public virtual void Add(OrderByTerm value)
 {
     this.List.Add(value);
 }
예제 #6
0
 /// <summary>
 /// Determines whether a specfic OrderByTerm value is in this OrderByTermCollection.
 /// </summary>
 /// <param name="value">
 /// The OrderByTerm value to locate in this OrderByTermCollection.
 /// </param>
 /// <returns>
 /// true if value is found in this OrderByTermCollection;
 /// false otherwise.
 /// </returns>
 public virtual bool Contains(OrderByTerm value)
 {
     return(this.List.Contains(value));
 }
예제 #7
0
 /// <summary>
 /// Inserts an element into the OrderByTermCollection at the specified index
 /// </summary>
 /// <param name="index">
 /// The index at which the OrderByTerm is to be inserted.
 /// </param>
 /// <param name="value">
 /// The OrderByTerm to insert.
 /// </param>
 public virtual void Insert(int index, OrderByTerm value)
 {
     this.List.Insert(index, value);
 }
예제 #8
0
 /// <summary>
 /// Removes the first occurrence of a specific OrderByTerm from this OrderByTermCollection.
 /// </summary>
 /// <param name="value">
 /// The OrderByTerm value to remove from this OrderByTermCollection.
 /// </param>
 public virtual void Remove(OrderByTerm value)
 {
     this.List.Remove(value);
 }
예제 #9
0
 /// <summary>
 /// Return the zero-based index of the first occurrence of a specific value
 /// in this OrderByTermCollection
 /// </summary>
 /// <param name="value">
 /// The OrderByTerm value to locate in the OrderByTermCollection.
 /// </param>
 /// <returns>
 /// The zero-based index of the first occurrence of the _ELEMENT value if found;
 /// -1 otherwise.
 /// </returns>
 public virtual int IndexOf(OrderByTerm value)
 {
     return(this.List.IndexOf(value));
 }
예제 #10
0
 /// <summary>Конструктор</summary>
 internal OrderBy(string field, OrderByDir dir)
 {
     Term = new OrderByTerm(field, null, dir);
 }
예제 #11
0
 /// <summary>Конструктор</summary>
 internal OrderBy(string field)
 {
     Term = new OrderByTerm(field, null, OrderByDir.Asc);
 }
예제 #12
0
 /// <summary>Конструктор</summary>
 internal OrderBy(string field, From table)
 {
     Term = new OrderByTerm(field, table != null ? table.Term : null, OrderByDir.Asc);
 }
예제 #13
0
 /// <summary>Конструктор</summary>
 internal OrderBy(string field, From table, OrderByDir dir)
 {
     Term = new OrderByTerm(field, table != null ? table.Term : null, dir);
 }