Class ArrayElementAggregates
Aggregates over the elements of an array in a grouping over the objects of a tree:
Agg.Sum(x.Props.SkillLevels.Select(v => v)) reaches the provider as the path SkillLevels[],
SkillLevels[0] as one index. The pivot of the grouping has one row per object and no column for the
elements, so they are aggregated per object in a derived table joined to the pivot row, and the grouping
aggregates those per-object figures: SUM of the sums, SUM of the counts, MIN of the minimums, MAX of the maximums,
and the average as the sum of the sums over the sum of the counts (an average of averages would weigh an object
of one element like one of ten). An object without elements joins nothing and counts as no element.
The SQL is the same on every engine but the cast of the average, which the caller passes.
public static class ArrayElementAggregates
Inheritance
Methods
Render(AggregateRequest, FieldInfo, int?, int, string, string, SqlParameterCollector, Func<string, string>)
The aggregate column and the join it reads. n makes the alias of the derived table unique
public static (string Column, string Join) Render(AggregateRequest aggregate, FieldInfo field, int? index, int n, string objectRef, string objectScope, SqlParameterCollector collector, Func<string, string> toDecimal)
TryParse(string?, out string, out int?)
Whether path names the elements of an array field: X[] or X[n].
public static bool TryParse(string? path, out string field, out int? index)