34 lines
879 B
C#
34 lines
879 B
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace Strata.SqlTools.SqlServer.ExpressionFactory.Query;
|
|
|
|
public class QueryConfig
|
|
{
|
|
public IEnumerable<Row> Rows { get; set; }
|
|
|
|
public IEnumerable<Value> Values { get; set; }
|
|
|
|
public IEnumerable<FilterGroup> FilterGroups { get; }
|
|
|
|
public bool WithTotals { get; set; }
|
|
|
|
public int RowLimit { get; set; }
|
|
|
|
public QueryConfig()
|
|
{
|
|
Rows = new List<Row>();
|
|
Values = new List<Value>();
|
|
FilterGroups = new List<FilterGroup>();
|
|
}
|
|
|
|
[JsonConstructor]
|
|
public QueryConfig(IEnumerable<FilterGroup> filterGroups, IEnumerable<Row> rows, IEnumerable<Value> values, bool withTotals, int rowLimit)
|
|
{
|
|
FilterGroups = filterGroups.Where(x => x.IsValid()).ToList();
|
|
Rows = rows;
|
|
Values = values;
|
|
WithTotals = withTotals;
|
|
RowLimit = rowLimit;
|
|
}
|
|
}
|