public void Add(Entity entity, ICollection<PropertyAggregatorUpdate> updates) { Count++; foreach (var u in updates) { _aggregators[u.Config.Index].Add(u.Values); } if (NoGroupResults) return; AggregationResult groupResult; var key = entity.GetKey(_keyIndex); if (!_groupResults.TryGetValue(key, out groupResult)) { groupResult = new AggregationResult(_metadata, _config, _keyIndex + 1); _groupResults.Add(key, groupResult); } groupResult.Add(entity, updates); }
public void Remove(Entity entity, ICollection<PropertyAggregatorUpdate> updates) { Count--; foreach (var u in updates) { _aggregators[u.Config.Index].Remove(u.Values); } if (NoGroupResults) return; var key = entity.GetKey(_keyIndex); var groupResult = _groupResults[key]; groupResult.Remove(entity, updates); if (groupResult.Count == 0) { _groupResults.Remove(key); } }
public void Update(Entity entity, ICollection<PropertyAggregatorUpdate> updates, PropertyMetadata property, decimal newValue) { foreach (var u in updates) { _aggregators[u.Config.Index].Update(u.Values, property, newValue); } if (NoGroupResults) return; var key = entity.GetKey(_keyIndex); var groupResult = _groupResults[key]; groupResult.Update(entity, updates, property, newValue); }