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