public static AggregationContainerDescriptor <T> StatsBy <T>(this AggregationContainerDescriptor <T> agg, Expression <Func <T, object> > fieldGetter) where T : class { var aggName = fieldGetter.GetAggName(AggType.Stats); return(agg.Stats(aggName, x => x.Field(fieldGetter))); }