Beispiel #1
0
 /// <summary>
 /// Removes the projection item from the output projection.
 /// </summary>
 /// <param name="projection">The projection item to remove.</param>
 /// <returns>True if the item was removed; otherwise, false.</returns>
 public bool RemoveOutputProjection(AliasedProjection projection)
 {
     if (projection == null)
     {
         throw new ArgumentNullException("projection");
     }
     return(_outputProjection.Remove(projection));
 }
Beispiel #2
0
 /// <summary>
 /// Removes the item from the partition.
 /// </summary>
 /// <param name="item">The item to remove.</param>
 /// <returns>True if the item was removed; otherwise, false.</returns>
 public bool RemovePartition(AliasedProjection item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     return(partitionItems.Remove(item));
 }
Beispiel #3
0
 /// <summary>
 /// Adds the item as a partitioner.
 /// </summary>
 /// <param name="item">The aliased projection to add.</param>
 public void AddPartition(AliasedProjection item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     partitionItems.Add(item);
 }
Beispiel #4
0
        /// <summary>
        /// Adds a projection item to the output projection.
        /// </summary>
        /// <param name="item">The projection item to add.</param>
        /// <param name="alias">The alias to refer to the item with.</param>
        /// <returns>The item that was added.</returns>
        public AliasedProjection AddOutputProjection(IProjectionItem item, string alias = null)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            AliasedProjection projection = new AliasedProjection(item, alias);

            _outputProjection.Add(projection);
            return(projection);
        }
Beispiel #5
0
        /// <summary>
        /// Adds the item as a partitioner.
        /// </summary>
        /// <param name="item">The item to partition the records on.</param>
        /// <returns>An aliased projection wrapping the given item.</returns>
        public AliasedProjection AddPartition(IProjectionItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            AliasedProjection projection = new AliasedProjection(item, null);

            partitionItems.Add(projection);
            return(projection);
        }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of a OrderBy.
 /// </summary>
 /// <param name="projection">The item to sort by.</param>
 /// <param name="order">The order in which to sort the items.</param>
 /// <param name="nullPlacement">The placement of nulls in the results.</param>
 public OrderBy(
     IProjectionItem projection,
     Order order = Order.Default,
     NullPlacement nullPlacement = NullPlacement.Default)
 {
     if (projection == null)
     {
         throw new ArgumentNullException("projection");
     }
     Projection    = new AliasedProjection(projection, null);
     Order         = order;
     NullPlacement = nullPlacement;
 }
Beispiel #7
0
 /// <summary>
 /// Initializes a new instance of a OrderBy.
 /// </summary>
 /// <param name="projection">The item to sort by.</param>
 /// <param name="order">The order in which to sort the items.</param>
 /// <param name="nullPlacement">The placement of nulls in the results.</param>
 public OrderBy(
     IProjectionItem projection,
     Order order = Order.Default,
     NullPlacement nullPlacement = NullPlacement.Default)
 {
     if (projection == null)
     {
         throw new ArgumentNullException("projection");
     }
     Projection = new AliasedProjection(projection, null);
     Order = order;
     NullPlacement = nullPlacement;
 }
 private void visitAliasedProjection(AliasedProjection projection)
 {
     if (valueReferenceType == ValueReferenceType.Declaration)
     {
         visitAliasedProjectionDeclaration(projection);
     }
     else if (valueReferenceType == ValueReferenceType.Reference)
     {
         visitAliasedProjectionReference(projection);
     }
     else if (valueReferenceType == ValueReferenceType.Alias)
     {
         visitAliasedProjectionAlias(projection);
     }
 }
 private void visitAliasedProjectionReference(AliasedProjection projection)
 {
     projection.ProjectionItem.Accept(forSubCommand());
 }
 private void visitAliasedProjectionDeclaration(AliasedProjection projection)
 {
     projection.ProjectionItem.Accept(forSubCommand());
     if (!String.IsNullOrWhiteSpace(projection.Alias) && !(projection.ProjectionItem is AllColumns))
     {
         writer.Write(" ");
         if (options.AliasProjectionsUsingAs)
         {
             writer.Write("AS ");
         }
         writer.Write(projection.Alias);
     }
 }
 private void visitAliasedProjectionAlias(AliasedProjection projection)
 {
     if (String.IsNullOrWhiteSpace(projection.Alias))
     {
         projection.ProjectionItem.Accept(forSubCommand());
     }
     else
     {
         writer.Write(projection.Alias);
     }
 }
 /// <summary>
 /// Removes the projection item from the projection.
 /// </summary>
 /// <param name="projection">The projection item to remove.</param>
 /// <returns>True if the item was removed; otherwise, false.</returns>
 public bool RemoveProjection(AliasedProjection projection)
 {
     if (projection == null)
     {
         throw new ArgumentNullException("projection");
     }
     return _projection.Remove(projection);
 }
 /// <summary>
 /// Adds a projection item to the projection.
 /// </summary>
 /// <param name="item">The projection item to add.</param>
 /// <param name="alias">The alias to refer to the item with.</param>
 /// <returns>The item that was added.</returns>
 public AliasedProjection AddProjection(IProjectionItem item, string alias = null)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     AliasedProjection projection = new AliasedProjection(item, alias);
     _projection.Add(projection);
     return projection;
 }
Beispiel #14
0
 /// <summary>
 /// Adds the item as a partitioner.
 /// </summary>
 /// <param name="item">The item to partition the records on.</param>
 /// <returns>An aliased projection wrapping the given item.</returns>
 public AliasedProjection AddPartition(IProjectionItem item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     AliasedProjection projection = new AliasedProjection(item, null);
     partitionItems.Add(projection);
     return projection;
 }
Beispiel #15
0
 /// <summary>
 /// Removes the item from the partition.
 /// </summary>
 /// <param name="item">The item to remove.</param>
 /// <returns>True if the item was removed; otherwise, false.</returns>
 public bool RemovePartition(AliasedProjection item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     return partitionItems.Remove(item);
 }
Beispiel #16
0
 /// <summary>
 /// Adds the item as a partitioner.
 /// </summary>
 /// <param name="item">The aliased projection to add.</param>
 public void AddPartition(AliasedProjection item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     partitionItems.Add(item);
 }