Exemple #1
0
        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)));
        }
Exemple #2
0
 protected Aggregate(AggregateKey key, ImmutableArray <ColumnKey> columnDependencies, ImmutableArray <AggregateKey> aggregateDependencies)
 {
     Key = key ?? throw new ArgumentNullException(nameof(key));
     ColumnDependencies    = columnDependencies;
     AggregateDependencies = aggregateDependencies;
 }