-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAvgFunction.cs
More file actions
28 lines (23 loc) · 896 Bytes
/
AvgFunction.cs
File metadata and controls
28 lines (23 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using Queries.Core.Parts.Columns;
using System;
namespace Queries.Core.Parts.Functions;
/// <summary>
/// The "average" function to apply to a <see cref="IColumn"/>.
/// </summary>
public class AvgFunction : AggregateFunction
{
/// <summary>
/// Builds a new <see cref="AvgFunction"/> instance.
/// </summary>
/// <param name="column">The column onto which the "average" function will be applied.</param>
public AvgFunction(IColumn column)
: base(AggregateType.Average, column)
{ }
/// <summary>
/// Builds a new <see cref="AvgFunction"/> instance.
/// </summary>
/// <param name="columnName">The name of the column onto which the "average" function will be applied.</param>
public AvgFunction(string columnName) : this(columnName?.Field()) { }
///<inheritdoc/>
public override IColumn Clone() => new AvgFunction(Column.Clone());
}