aggregate support.
This commit is contained in:
parent
7a8ee0895c
commit
94d241590e
@ -82,6 +82,18 @@ namespace PoweredSoft.DynamicQuery
|
||||
{
|
||||
var matchingAggregate = FindMatchingAggregateResult(aggregateResults, previousGroups, previousGroupResults);
|
||||
cgrr.Aggregates = new List<IAggregateResult>();
|
||||
Criteria.Aggregates.ForEach(a =>
|
||||
{
|
||||
var pathCleaned = a.Path?.Replace(".", "");
|
||||
var key = $"Agg_{a.Type}_{pathCleaned}";
|
||||
var aggregateResult = new AggregateResult
|
||||
{
|
||||
Path = a.Path,
|
||||
Type = a.Type,
|
||||
Value = matchingAggregate.GetDynamicPropertyValue(key)
|
||||
};
|
||||
cgrr.Aggregates.Add(aggregateResult);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -14,6 +14,8 @@ namespace PoweredSoft.DynamicQuery
|
||||
public string Path { get; set; }
|
||||
public AggregateType Type { get; set; }
|
||||
public object Value { get; set; }
|
||||
|
||||
public bool ShouldSerializePath() => !string.IsNullOrWhiteSpace(Path);
|
||||
}
|
||||
|
||||
// part of a result.
|
||||
|
Loading…
Reference in New Issue
Block a user