public static SingleGroupAggregator Create( AggregateOperator[] aggregates, IReadOnlyDictionary <string, AggregateOperator?> aggregateAliasToAggregateType, bool hasSelectValue) { SingleGroupAggregator aggregateValues; if (hasSelectValue) { if (aggregates != null && aggregates.Any()) { // SELECT VALUE <AGGREGATE> aggregateValues = SelectValueAggregateValues.Create(aggregates[0]); } else { // SELECT VALUE <NON AGGREGATE> aggregateValues = SelectValueAggregateValues.Create(aggregateOperator: null); } } else { aggregateValues = SelectListAggregateValues.Create(aggregateAliasToAggregateType); } return(aggregateValues); }
public static SingleGroupAggregator Create( CosmosQueryClient queryClient, AggregateOperator[] aggregates, IReadOnlyDictionary <string, AggregateOperator?> aggregateAliasToAggregateType, IReadOnlyList <string> orderedAliases, bool hasSelectValue, string continuationToken) { SingleGroupAggregator aggregateValues; if (hasSelectValue) { if (aggregates != null && aggregates.Any()) { // SELECT VALUE <AGGREGATE> aggregateValues = SelectValueAggregateValues.Create(aggregates[0], continuationToken); } else { // SELECT VALUE <NON AGGREGATE> aggregateValues = SelectValueAggregateValues.Create(aggregateOperator: null, continuationToken: continuationToken); } } else { aggregateValues = SelectListAggregateValues.Create(queryClient, aggregateAliasToAggregateType, orderedAliases, continuationToken); } return(aggregateValues); }
public static TryCatch <SingleGroupAggregator> TryCreate( IReadOnlyList <AggregateOperator> aggregates, IReadOnlyDictionary <string, AggregateOperator?> aggregateAliasToAggregateType, IReadOnlyList <string> orderedAliases, bool hasSelectValue, CosmosElement continuationToken) { if (aggregates == null) { throw new ArgumentNullException(nameof(aggregates)); } if (aggregateAliasToAggregateType == null) { throw new ArgumentNullException(nameof(aggregates)); } TryCatch <SingleGroupAggregator> tryCreateSingleGroupAggregator; if (hasSelectValue) { if (aggregates != null && aggregates.Any()) { // SELECT VALUE <AGGREGATE> tryCreateSingleGroupAggregator = SelectValueAggregateValues.TryCreate( aggregates[0], continuationToken); } else { // SELECT VALUE <NON AGGREGATE> tryCreateSingleGroupAggregator = SelectValueAggregateValues.TryCreate( aggregateOperator: null, continuationToken: continuationToken); } } else { tryCreateSingleGroupAggregator = SelectListAggregateValues.TryCreate( aggregateAliasToAggregateType, orderedAliases, continuationToken); } return(tryCreateSingleGroupAggregator); }