5.2.0 (latest) 5.1.0 5.0.0 4.17.0 4.16.0 4.15.0 4.14.0 4.13.0 4.12.0 4.11.0 4.10.0 4.9.0 4.8.0 4.7.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.5.0 3.4.0 3.3.0 3.2.0

    public static class Aggregations

Reference documentation and code samples for the Google Cloud Datastore v1 API class Aggregations.

Factory for different types of Aggregations.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> Aggregations

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Datastore.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1)

## Assembly

Google.Cloud.Datastore.V1.dll

## Methods

### Average(string, string)

    public static AggregationQuery.Types.Aggregation Average(string property, string alias = "")

Returns an instance of an average aggregation for the specified property.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `property` | `https://learn.microsoft.com/dotnet/api/system.string` Property for which the average is to be calculated. Must not be null. |
| `alias` | `https://learn.microsoft.com/dotnet/api/system.string` A string used to retrieve the result of this aggregation. If this is not provided, Datastore will pick a default name with a prefix of `property_` followed by an auto-incremented ID, e.g. `property_1`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery.Types.Aggregation` | An average aggregation for the specified property. |

### Count(string)

    public static AggregationQuery.Types.Aggregation Count(string alias = "")

Returns an instance of count(\*) aggregation.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `alias` | `https://learn.microsoft.com/dotnet/api/system.string` A string used to retrieve the result of this aggregation. If this is not provided, Datastore will pick a default name with a prefix of `property_` followed by an auto-incremented ID, e.g. `property_1`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery.Types.Aggregation` | A count(\*) aggregation. |

### Sum(string, string)

    public static AggregationQuery.Types.Aggregation Sum(string property, string alias = "")

Returns an instance of a sum aggregation for the specified property.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `property` | `https://learn.microsoft.com/dotnet/api/system.string` Property for which the sum is to be calculated. Must not be null. |
| `alias` | `https://learn.microsoft.com/dotnet/api/system.string` A string used to retrieve the result of this aggregation. If this is not provided, Datastore will pick a default name with a prefix of `property_` followed by an auto-incremented ID, e.g. `property_1`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery.Types.Aggregation` | A sum aggregation for the specified property. |