@@ -50,6 +50,10 @@ public static implicit operator AggregationDictionary(AggregationBase aggregator
5050 [ JsonConverter ( typeof ( ReadAsTypeJsonConverter < AggregationContainer > ) ) ]
5151 public interface IAggregationContainer
5252 {
53+ [ JsonProperty ( "meta" ) ]
54+ [ JsonConverter ( typeof ( VerbatimDictionaryKeysJsonConverter ) ) ]
55+ IDictionary < string , object > Meta { get ; set ; }
56+
5357 [ JsonProperty ( "avg" ) ]
5458 IAverageAggregation Average { get ; set ; }
5559
@@ -178,6 +182,7 @@ public interface IAggregationContainer
178182
179183 public class AggregationContainer : IAggregationContainer
180184 {
185+ public IDictionary < string , object > Meta { get ; set ; }
181186 public IAverageAggregation Average { get ; set ; }
182187 public IValueCountAggregation ValueCount { get ; set ; }
183188 public IMaxAggregation Max { get ; set ; }
@@ -273,6 +278,8 @@ public void Accept(IAggregationVisitor visitor)
273278 public class AggregationContainerDescriptor < T > : DescriptorBase < AggregationContainerDescriptor < T > , IAggregationContainer > , IAggregationContainer
274279 where T : class
275280 {
281+ IDictionary < string , object > IAggregationContainer . Meta { get ; set ; }
282+
276283 AggregationDictionary IAggregationContainer . Aggregations { get ; set ; }
277284
278285 IAverageAggregation IAggregationContainer . Average { get ; set ; }
@@ -527,9 +534,10 @@ Func<TAggregator, TAggregatorInterface> selector
527534 where TAggregatorInterface : IAggregation
528535 {
529536 var aggregator = selector ( new TAggregator ( ) ) ;
530-
537+
531538 //create new isolated container for new aggregator and assign to the right property
532- var container = new AggregationContainer ( ) ;
539+ var container = new AggregationContainer ( ) { Meta = aggregator . Meta } ;
540+
533541 assignToProperty ( container , aggregator ) ;
534542
535543 //create aggregations dictionary on `this` if it does not exist already
0 commit comments