private void CalculateAggregate(AggregateKey key) { ImmutableArray <Int32> columnMapping = ColumnDependencyMappings[key]; ImmutableArray <Int32> aggregateMapping = AggregateDependencyMappings[key]; AggregateValueBag aggregateBag = new AggregateValueBag(AggregateRow, aggregateMapping); Aggregate <TInput> aggregate = Aggregates[key]; Int32 aggregateIndex = AggregateIndexes[key]; AggregateRow[aggregateIndex] = aggregate.Calculate(aggregateBag, Rows.Select(row => new ColumnValueBag <TInput>(row, columnMapping))); }
protected Aggregate(AggregateKey key, ImmutableArray <ColumnKey> columnDependencies, ImmutableArray <AggregateKey> aggregateDependencies) { Key = key ?? throw new ArgumentNullException(nameof(key)); ColumnDependencies = columnDependencies; AggregateDependencies = aggregateDependencies; }