5.3.0 (latest) 5.2.0 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 sealed class DatastoreDbImpl : DatastoreDb

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

Wrapper around [DatastoreClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreClient) to provide simpler operations.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [DatastoreDb](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb) \> DatastoreDbImpl

## Inherited Members

[DatastoreDb.Create(string, string, DatastoreClient)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Create_System_String_System_String_Google_Cloud_Datastore_V1_DatastoreClient_) [DatastoreDb.RunQuery(DatastoreQuery, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunQuery_Google_Cloud_Datastore_V1_DatastoreQuery_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.RunQuery(Query, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunQuery_Google_Cloud_Datastore_V1_Query_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.RunQueryAsync(DatastoreQuery, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunQueryAsync_Google_Cloud_Datastore_V1_DatastoreQuery_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.RunQueryAsync(Query, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunQueryAsync_Google_Cloud_Datastore_V1_Query_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.RunQuery(GqlQuery, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunQuery_Google_Cloud_Datastore_V1_GqlQuery_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.RunQueryAsync(GqlQuery, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunQueryAsync_Google_Cloud_Datastore_V1_GqlQuery_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.AllocateId(Key, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_AllocateId_Google_Cloud_Datastore_V1_Key_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.AllocateIds(params Key\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_AllocateIds_Google_Cloud_Datastore_V1_Key___) [DatastoreDb.AllocateIdAsync(Key, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_AllocateIdAsync_Google_Cloud_Datastore_V1_Key_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.AllocateIdsAsync(params Key\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_AllocateIdsAsync_Google_Cloud_Datastore_V1_Key___) [DatastoreDb.Lookup(Key, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Lookup_Google_Cloud_Datastore_V1_Key_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.Lookup(params Key\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Lookup_Google_Cloud_Datastore_V1_Key___) [DatastoreDb.LookupAsync(Key, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_LookupAsync_Google_Cloud_Datastore_V1_Key_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.LookupAsync(params Key\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_LookupAsync_Google_Cloud_Datastore_V1_Key___) [DatastoreDb.Insert(Entity, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Insert_Google_Cloud_Datastore_V1_Entity_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.Insert(params Entity\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Insert_Google_Cloud_Datastore_V1_Entity___) [DatastoreDb.InsertAsync(Entity, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_InsertAsync_Google_Cloud_Datastore_V1_Entity_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.InsertAsync(params Entity\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_InsertAsync_Google_Cloud_Datastore_V1_Entity___) [DatastoreDb.Upsert(Entity, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Upsert_Google_Cloud_Datastore_V1_Entity_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.Upsert(params Entity\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Upsert_Google_Cloud_Datastore_V1_Entity___) [DatastoreDb.UpsertAsync(Entity, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_UpsertAsync_Google_Cloud_Datastore_V1_Entity_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.UpsertAsync(params Entity\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_UpsertAsync_Google_Cloud_Datastore_V1_Entity___) [DatastoreDb.Update(Entity, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Update_Google_Cloud_Datastore_V1_Entity_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.Update(params Entity\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Update_Google_Cloud_Datastore_V1_Entity___) [DatastoreDb.UpdateAsync(Entity, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_UpdateAsync_Google_Cloud_Datastore_V1_Entity_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.UpdateAsync(params Entity\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_UpdateAsync_Google_Cloud_Datastore_V1_Entity___) [DatastoreDb.Delete(Entity, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Delete_Google_Cloud_Datastore_V1_Entity_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.Delete(params Entity\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Delete_Google_Cloud_Datastore_V1_Entity___) [DatastoreDb.DeleteAsync(Entity, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_DeleteAsync_Google_Cloud_Datastore_V1_Entity_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.DeleteAsync(params Entity\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_DeleteAsync_Google_Cloud_Datastore_V1_Entity___) [DatastoreDb.Delete(Key, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Delete_Google_Cloud_Datastore_V1_Key_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.Delete(params Key\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Delete_Google_Cloud_Datastore_V1_Key___) [DatastoreDb.DeleteAsync(Key, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_DeleteAsync_Google_Cloud_Datastore_V1_Key_Google_Api_Gax_Grpc_CallSettings_) [DatastoreDb.DeleteAsync(params Key\[\])](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_DeleteAsync_Google_Cloud_Datastore_V1_Key___) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [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

## Remarks

This is the "default" implementation of [DatastoreDb](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb). Most client code
should refer to [DatastoreDb](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb), creating instances with
[Create(string, string, DatastoreClient)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Create_System_String_System_String_Google_Cloud_Datastore_V1_DatastoreClient_). The constructor
of this class is public for the sake of constructor-based dependency injection.

## Constructors

### DatastoreDbImpl(string, string, DatastoreClient)

    public DatastoreDbImpl(string projectId, string namespaceId, DatastoreClient client)

Constructs an instance from the given project ID, namespace ID and client.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://learn.microsoft.com/dotnet/api/system.string` The project ID. Must not be null. |
| `namespaceId` | `https://learn.microsoft.com/dotnet/api/system.string` The namespace ID. Must not be null. |
| `client` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreClient` The client to use for underlying operations. Must not be null. |

**Remarks** This constructor is primarily provided for constructor-based dependency injection.
The static [Create(string, string, DatastoreClient)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Create_System_String_System_String_Google_Cloud_Datastore_V1_DatastoreClient_) method is provided
for manually obtaining an instance, including automatic client creation.

### DatastoreDbImpl(string, string, string, DatastoreClient)

    public DatastoreDbImpl(string projectId, string namespaceId, string databaseId, DatastoreClient client)

Constructs an instance from the given project ID, namespace ID and client.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://learn.microsoft.com/dotnet/api/system.string` The project ID. Must not be null. |
| `namespaceId` | `https://learn.microsoft.com/dotnet/api/system.string` The namespace ID. Must not be null. |
| `databaseId` | `https://learn.microsoft.com/dotnet/api/system.string` The database ID. Must not be null. |
| `client` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreClient` The client to use for underlying operations. Must not be null. |

## Properties

### Client

    public override DatastoreClient Client { get; }

The [DatastoreClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreClient) used for all remote operations.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreClient` |   |

**Overrides** [DatastoreDb.Client](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Client)

### DatabaseId

    public override string DatabaseId { get; }

The ID of the database against which the request is to be made.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

**Overrides** [DatastoreDb.DatabaseId](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_DatabaseId)

### NamespaceId

    public override string NamespaceId { get; }

The ID of the namespace this instance operates on.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

**Overrides** [DatastoreDb.NamespaceId](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_NamespaceId)

### ProjectId

    public override string ProjectId { get; }

The ID of the project this instance operates on.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

**Overrides** [DatastoreDb.ProjectId](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_ProjectId)

## Methods

### AllocateIds(IEnumerable\<Key\>, CallSettings)

    public override IReadOnlyList<Key> AllocateIds(IEnumerable<Key> keys, CallSettings callSettings = null)

Allocates IDs for a collection of incomplete keys.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `keys` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Key` The incomplete keys. Must not be null or contain null elements. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Key` | A collection of complete keys with allocated IDs, in the same order as `keys`. |

**Overrides** [DatastoreDb.AllocateIds(IEnumerable\<Key\>, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_AllocateIds_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Key__Google_Api_Gax_Grpc_CallSettings_) **Remarks** Datastore limits the number of keys that can be allocated in a single operation. When allocating a large
number of keys, partition the allocations into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.

### AllocateIdsAsync(IEnumerable\<Key\>, CallSettings)

    public override Task<IReadOnlyList<Key>> AllocateIdsAsync(IEnumerable<Key> keys, CallSettings callSettings = null)

Allocates IDs for a collection of incomplete keys asynchronously.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `keys` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Key` The incomplete keys. Must not be null or contain null elements. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Key` | A collection of complete keys with allocated IDs, in the same order as `keys`. |

**Overrides** [DatastoreDb.AllocateIdsAsync(IEnumerable\<Key\>, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_AllocateIdsAsync_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Key__Google_Api_Gax_Grpc_CallSettings_) **Remarks** Datastore limits the number of keys that can be allocated in a single operation. When allocating a large
number of keys, partition the allocations into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.

### BeginTransaction(CallSettings)

    public override DatastoreTransaction BeginTransaction(CallSettings callSettings = null)

Begins a transaction, returning a [DatastoreTransaction](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreTransaction) which can be used to operate on the transaction.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreTransaction` | A new [DatastoreTransaction](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreTransaction) for this object's project. |

**Overrides** [DatastoreDb.BeginTransaction(CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_BeginTransaction_Google_Api_Gax_Grpc_CallSettings_)

### BeginTransaction(TransactionOptions, CallSettings)

    public override DatastoreTransaction BeginTransaction(TransactionOptions options, CallSettings callSettings = null)

Begins a transaction, returning a [DatastoreTransaction](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreTransaction) which can be used to operate on the transaction.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.TransactionOptions` The options for the new transaction. May be null, for default options. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreTransaction` | A new [DatastoreTransaction](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreTransaction) for this object's project. |

**Overrides** [DatastoreDb.BeginTransaction(TransactionOptions, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_BeginTransaction_Google_Cloud_Datastore_V1_TransactionOptions_Google_Api_Gax_Grpc_CallSettings_)

### BeginTransactionAsync(CallSettings)

    public override Task<DatastoreTransaction> BeginTransactionAsync(CallSettings callSettings = null)

Begins a transaction asynchronously, returning a [DatastoreTransaction](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreTransaction) which can be used to operate on the transaction.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreTransaction` | A new [DatastoreTransaction](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreTransaction) for this object's project. |

**Overrides** [DatastoreDb.BeginTransactionAsync(CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_BeginTransactionAsync_Google_Api_Gax_Grpc_CallSettings_)

### BeginTransactionAsync(TransactionOptions, CallSettings)

    public override Task<DatastoreTransaction> BeginTransactionAsync(TransactionOptions options, CallSettings callSettings = null)

Begins a transaction asynchronously, returning a [DatastoreTransaction](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreTransaction) which can be used to operate on the transaction.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.TransactionOptions` The options for the new transaction. May be null, for default options. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreTransaction` | A new [DatastoreTransaction](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreTransaction) for this object's project. |

**Overrides** [DatastoreDb.BeginTransactionAsync(TransactionOptions, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_BeginTransactionAsync_Google_Cloud_Datastore_V1_TransactionOptions_Google_Api_Gax_Grpc_CallSettings_)

### CreateKeyFactory(string)

    public override KeyFactory CreateKeyFactory(string kind)

Creates a key factory for root entities in this objects's partition.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `kind` | `https://learn.microsoft.com/dotnet/api/system.string` The kind of entity key to create. Must not be null. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.KeyFactory` | A key factory with the specified kind and this object's partition. |

**Overrides** [DatastoreDb.CreateKeyFactory(string)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_CreateKeyFactory_System_String_)

### Delete(IEnumerable\<Entity\>, CallSettings)

    public override void Delete(IEnumerable<Entity> entities, CallSettings callSettings = null)

Deletes a collection of entities, non-transactionally.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `entities` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity` The entities to delete. Must not be null or contain null entries. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

**Overrides** [DatastoreDb.Delete(IEnumerable\<Entity\>, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Delete_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Entity__Google_Api_Gax_Grpc_CallSettings_) **Remarks** Datastore limits the number of entities that can be modified in a Commit operation. Although this method does not
use an existing transaction, it still performs all the work in a single Commit operation. When modifying a large
number of entities, partition the changes into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.

### Delete(IEnumerable\<Key\>, CallSettings)

    public override void Delete(IEnumerable<Key> keys, CallSettings callSettings = null)

Deletes a collection of keys, non-transactionally.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `keys` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Key` The keys to delete. Must not be null or contain null entries. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

**Overrides** [DatastoreDb.Delete(IEnumerable\<Key\>, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Delete_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Key__Google_Api_Gax_Grpc_CallSettings_) **Remarks** Datastore limits the number of entities that can be modified in a Commit operation. Although this method does not
use an existing transaction, it still performs all the work in a single Commit operation. When modifying a large
number of entities, partition the changes into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.

### DeleteAsync(IEnumerable\<Entity\>, CallSettings)

    public override Task DeleteAsync(IEnumerable<Entity> entities, CallSettings callSettings = null)

Deletes a collection of entities, non-transactionally and asynchronously.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `entities` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity` The entities to delete. Must not be null or contain null entries. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous operation. |

**Overrides** [DatastoreDb.DeleteAsync(IEnumerable\<Entity\>, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_DeleteAsync_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Entity__Google_Api_Gax_Grpc_CallSettings_) **Remarks** Datastore limits the number of entities that can be modified in a Commit operation. Although this method does not
use an existing transaction, it still performs all the work in a single Commit operation. When modifying a large
number of entities, partition the changes into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.

### DeleteAsync(IEnumerable\<Key\>, CallSettings)

    public override Task DeleteAsync(IEnumerable<Key> keys, CallSettings callSettings = null)

Deletes a collection of keys, non-transactionally and asynchronously.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `keys` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Key` The keys to delete. Must not be null or contain null entries. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` |   |

**Overrides** [DatastoreDb.DeleteAsync(IEnumerable\<Key\>, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_DeleteAsync_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Key__Google_Api_Gax_Grpc_CallSettings_) **Remarks** Datastore limits the number of entities that can be modified in a Commit operation. Although this method does not
use an existing transaction, it still performs all the work in a single Commit operation. When modifying a large
number of entities, partition the changes into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.

### Insert(IEnumerable\<Entity\>, CallSettings)

    public override IReadOnlyList<Key> Insert(IEnumerable<Entity> entities, CallSettings callSettings = null)

Inserts a collection of entities, non-transactionally.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `entities` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity` The entities to insert. Must not be null or contain null entries. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Key` | A collection of keys of inserted entities, in the same order as `entities`. Only keys allocated by the server will be returned; any entity with a predefined key will have a null value in the collection. |

**Overrides** [DatastoreDb.Insert(IEnumerable\<Entity\>, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Insert_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Entity__Google_Api_Gax_Grpc_CallSettings_) **Remarks** On success, the entities will be updated in memory with the server-allocated keys.

Datastore limits the number of entities that can be modified in a Commit operation. Although this method does not
use an existing transaction, it still performs all the work in a single Commit operation. When modifying a large
number of entities, partition the changes into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.

### InsertAsync(IEnumerable\<Entity\>, CallSettings)

    public override Task<IReadOnlyList<Key>> InsertAsync(IEnumerable<Entity> entities, CallSettings callSettings = null)

Inserts a collection of entities, non-transactionally and asynchronously.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `entities` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity` The entities to insert. Must not be null or contain null entries. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Key` | A task representing the asynchronous operation. The result of the task is a collection of keys of inserted entities, in the same order as `entities`. Only keys allocated by the server will be returned; any entity with a predefined key will have a null value in the collection. |

**Overrides** [DatastoreDb.InsertAsync(IEnumerable\<Entity\>, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_InsertAsync_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Entity__Google_Api_Gax_Grpc_CallSettings_) **Remarks** On success, the entities will be updated in memory with the server-allocated keys.

Datastore limits the number of entities that can be looked up in a single operation. When looking up a large
number of entities, partition the look-ups into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.

### Lookup(IEnumerable\<Key\>, ReadConsistency?, CallSettings)

    public override IReadOnlyList<Entity> Lookup(IEnumerable<Key> keys, ReadOptions.Types.ReadConsistency? readConsistency = null, CallSettings callSettings = null)

Looks up a collection of entities by key.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `keys` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Key` The keys to look up. Must not be null, and every element must be non-null and refer to a complete key. |
| `readConsistency` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Types.ReadConsistency` The desired read consistency of the lookup, or null to use the default. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity` | A collection of entities with the same size as `keys`, containing corresponding entity references, or `null` where the key was not found. |

**Overrides** [DatastoreDb.Lookup(IEnumerable\<Key\>, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Lookup_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Key__System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_) **Remarks** This call may perform multiple RPC operations in order to look up all keys.

Datastore limits the number of entities that can be looked up in a single operation. When looking up a large
number of entities, partition the look-ups into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.

### LookupAsync(IEnumerable\<Key\>, ReadConsistency?, CallSettings)

    public override Task<IReadOnlyList<Entity>> LookupAsync(IEnumerable<Key> keys, ReadOptions.Types.ReadConsistency? readConsistency = null, CallSettings callSettings = null)

Looks up a collection of entities by key asynchronously.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `keys` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Key` The keys to look up. Must not be null, and every element must be non-null and refer to a complete key. |
| `readConsistency` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Types.ReadConsistency` The desired read consistency of the lookup, or null to use the default. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity` | A collection of entities with the same size as `keys`, containing corresponding entity references, or `null` where the key was not found. |

**Overrides** [DatastoreDb.LookupAsync(IEnumerable\<Key\>, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_LookupAsync_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Key__System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_) **Remarks** This call may perform multiple RPC operations in order to look up all keys.

Datastore limits the number of entities that can be looked up in a single operation. When looking up a large
number of entities, partition the look-ups into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.

### RunAggregationQuery(AggregationQuery, ReadConsistency?, CallSettings)

    public override AggregationQueryResults RunAggregationQuery(AggregationQuery query, ReadOptions.Types.ReadConsistency? readConsistency = null, CallSettings callSettings = null)

Executes the given structured query.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `query` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery` The query to execute. Must not be null. |
| `readConsistency` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Types.ReadConsistency` If not null, overrides the read consistency of the query. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryResults` | An [AggregationQueryResults](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryResults) holds result of aggregations. |

**Overrides** [DatastoreDb.RunAggregationQuery(AggregationQuery, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunAggregationQuery_Google_Cloud_Datastore_V1_AggregationQuery_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_)

### RunAggregationQuery(DatastoreQuery, CallSettings)

    public override AggregationQueryResults RunAggregationQuery(DatastoreQuery query, CallSettings callSettings = null)

Executes the given query.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `query` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreQuery` The query to execute. Must not be null. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryResults` | An [AggregationQueryResults](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryResults) holds result of aggregations. |

**Overrides** [DatastoreDb.RunAggregationQuery(DatastoreQuery, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunAggregationQuery_Google_Cloud_Datastore_V1_DatastoreQuery_Google_Api_Gax_Grpc_CallSettings_)

### RunAggregationQuery(GqlQuery, ReadConsistency?, CallSettings)

    public override AggregationQueryResults RunAggregationQuery(GqlQuery query, ReadOptions.Types.ReadConsistency? readConsistency = null, CallSettings callSettings = null)

Executes the given GQL query.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `query` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.GqlQuery` The query to execute. Must not be null. |
| `readConsistency` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Types.ReadConsistency` If not null, overrides the read consistency of the query. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryResults` | An [AggregationQueryResults](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryResults) holds result of aggregations. |

**Overrides** [DatastoreDb.RunAggregationQuery(GqlQuery, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunAggregationQuery_Google_Cloud_Datastore_V1_GqlQuery_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_)

### RunAggregationQueryAsync(AggregationQuery, ReadConsistency?, CallSettings)

    public override Task<AggregationQueryResults> RunAggregationQueryAsync(AggregationQuery query, ReadOptions.Types.ReadConsistency? readConsistency = null, CallSettings callSettings = null)

Executes the given structured query.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `query` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery` The query to execute. Must not be null. |
| `readConsistency` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Types.ReadConsistency` If not null, overrides the read consistency of the query. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryResults` | An [AggregationQueryResults](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryResults) holds result of aggregations. |

**Overrides** [DatastoreDb.RunAggregationQueryAsync(AggregationQuery, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunAggregationQueryAsync_Google_Cloud_Datastore_V1_AggregationQuery_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_)

### RunAggregationQueryAsync(DatastoreQuery, CallSettings)

    public override Task<AggregationQueryResults> RunAggregationQueryAsync(DatastoreQuery query, CallSettings callSettings = null)

Executes the given query.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `query` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreQuery` The query to execute. Must not be null. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryResults` | An [AggregationQueryResults](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryResults) holds result of aggregations. |

**Overrides** [DatastoreDb.RunAggregationQueryAsync(DatastoreQuery, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunAggregationQueryAsync_Google_Cloud_Datastore_V1_DatastoreQuery_Google_Api_Gax_Grpc_CallSettings_)

### RunAggregationQueryAsync(GqlQuery, ReadConsistency?, CallSettings)

    public override Task<AggregationQueryResults> RunAggregationQueryAsync(GqlQuery query, ReadOptions.Types.ReadConsistency? readConsistency = null, CallSettings callSettings = null)

Executes the given GQL query.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `query` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.GqlQuery` The query to execute. Must not be null. |
| `readConsistency` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Types.ReadConsistency` If not null, overrides the read consistency of the query. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryResults` | An [AggregationQueryResults](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQueryResults) holds result of aggregations. |

**Overrides** [DatastoreDb.RunAggregationQueryAsync(GqlQuery, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunAggregationQueryAsync_Google_Cloud_Datastore_V1_GqlQuery_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_)

### RunQueryLazily(DatastoreQuery, CallSettings)

    public override LazyDatastoreQuery RunQueryLazily(DatastoreQuery query, CallSettings callSettings = null)

Lazily executes the given structured query.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `query` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreQuery` The query to execute. Must not be null. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.LazyDatastoreQuery` | A [LazyDatastoreQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.LazyDatastoreQuery) representing the lazy query results. |

**Overrides** [DatastoreDb.RunQueryLazily(DatastoreQuery, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunQueryLazily_Google_Cloud_Datastore_V1_DatastoreQuery_Google_Api_Gax_Grpc_CallSettings_) **Remarks** The results are requested lazily: no API calls will be made until the application starts
iterating over the results. Iterating over the same [LazyDatastoreQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.LazyDatastoreQuery) object
multiple times will execute the query again, potentially returning different results.

### RunQueryLazily(GqlQuery, ReadConsistency?, CallSettings)

    public override LazyDatastoreQuery RunQueryLazily(GqlQuery gqlQuery, ReadOptions.Types.ReadConsistency? readConsistency = null, CallSettings callSettings = null)

Lazily executes the given GQL query for asynchronous consumption.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `gqlQuery` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.GqlQuery` The query to execute. Must not be null. |
| `readConsistency` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Types.ReadConsistency` If not null, overrides the read consistency of the query. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.LazyDatastoreQuery` | A [LazyDatastoreQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.LazyDatastoreQuery) representing the lazy query results. |

**Overrides** [DatastoreDb.RunQueryLazily(GqlQuery, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunQueryLazily_Google_Cloud_Datastore_V1_GqlQuery_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_) **Remarks** The results are requested lazily: no API calls will be made until the application starts
iterating over the results. Iterating over the same [LazyDatastoreQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.LazyDatastoreQuery) object
multiple times will execute the query again, potentially returning different results.

### RunQueryLazily(Query, ReadConsistency?, CallSettings)

    public override LazyDatastoreQuery RunQueryLazily(Query query, ReadOptions.Types.ReadConsistency? readConsistency = null, CallSettings callSettings = null)

Lazily executes the given structured query.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `query` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Query` The query to execute. Must not be null. |
| `readConsistency` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Types.ReadConsistency` If not null, overrides the read consistency of the query. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.LazyDatastoreQuery` | A [LazyDatastoreQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.LazyDatastoreQuery) representing the lazy query results. |

**Overrides** [DatastoreDb.RunQueryLazily(Query, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunQueryLazily_Google_Cloud_Datastore_V1_Query_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_) **Remarks** The results are requested lazily: no API calls will be made until the application starts
iterating over the results. Iterating over the same [LazyDatastoreQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.LazyDatastoreQuery) object
multiple times will execute the query again, potentially returning different results.

### RunQueryLazilyAsync(DatastoreQuery, CallSettings)

    public override AsyncLazyDatastoreQuery RunQueryLazilyAsync(DatastoreQuery query, CallSettings callSettings = null)

Lazily executes the given structured query for asynchronous consumption.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `query` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreQuery` The query to execute. Must not be null. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AsyncLazyDatastoreQuery` | An [AsyncLazyDatastoreQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AsyncLazyDatastoreQuery) representing the lazy query results. |

**Overrides** [DatastoreDb.RunQueryLazilyAsync(DatastoreQuery, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunQueryLazilyAsync_Google_Cloud_Datastore_V1_DatastoreQuery_Google_Api_Gax_Grpc_CallSettings_) **Remarks** The results are requested lazily: no API calls will be made until the application starts
iterating over the results. Iterating over the same [LazyDatastoreQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.LazyDatastoreQuery) object
multiple times will execute the query again, potentially returning different results.

### RunQueryLazilyAsync(GqlQuery, ReadConsistency?, CallSettings)

    public override AsyncLazyDatastoreQuery RunQueryLazilyAsync(GqlQuery gqlQuery, ReadOptions.Types.ReadConsistency? readConsistency = null, CallSettings callSettings = null)

Lazily executes the given GQL query for asynchronous consumption.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `gqlQuery` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.GqlQuery` The query to execute. Must not be null. |
| `readConsistency` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Types.ReadConsistency` If not null, overrides the read consistency of the query. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AsyncLazyDatastoreQuery` | An [AsyncLazyDatastoreQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AsyncLazyDatastoreQuery) representing the lazy query results. |

**Overrides** [DatastoreDb.RunQueryLazilyAsync(GqlQuery, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunQueryLazilyAsync_Google_Cloud_Datastore_V1_GqlQuery_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_) **Remarks** The results are requested lazily: no API calls will be made until the application starts
iterating over the results. Iterating over the same [LazyDatastoreQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.LazyDatastoreQuery) object
multiple times will execute the query again, potentially returning different results.

### RunQueryLazilyAsync(Query, ReadConsistency?, CallSettings)

    public override AsyncLazyDatastoreQuery RunQueryLazilyAsync(Query query, ReadOptions.Types.ReadConsistency? readConsistency = null, CallSettings callSettings = null)

Lazily executes the given structured query for asynchronous consumption.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `query` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Query` The query to execute. Must not be null. |
| `readConsistency` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Types.ReadConsistency` If not null, overrides the read consistency of the query. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to RPC calls. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AsyncLazyDatastoreQuery` | An [AsyncLazyDatastoreQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AsyncLazyDatastoreQuery) representing the lazy query results. |

**Overrides** [DatastoreDb.RunQueryLazilyAsync(Query, ReadOptions.Types.ReadConsistency?, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_RunQueryLazilyAsync_Google_Cloud_Datastore_V1_Query_System_Nullable_Google_Cloud_Datastore_V1_ReadOptions_Types_ReadConsistency__Google_Api_Gax_Grpc_CallSettings_) **Remarks** The results are requested lazily: no API calls will be made until the application starts
iterating over the results. Iterating over the same [LazyDatastoreQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.LazyDatastoreQuery) object
multiple times will execute the query again, potentially returning different results.

### Update(IEnumerable\<Entity\>, CallSettings)

    public override void Update(IEnumerable<Entity> entities, CallSettings callSettings = null)

Updates a collection of entities, non-transactionally.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `entities` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity` The entities to update. Must not be null or contain null entries. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

**Overrides** [DatastoreDb.Update(IEnumerable\<Entity\>, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Update_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Entity__Google_Api_Gax_Grpc_CallSettings_) **Remarks** Datastore limits the number of entities that can be looked up in a single operation. When looking up a large
number of entities, partition the look-ups into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.

### UpdateAsync(IEnumerable\<Entity\>, CallSettings)

    public override Task UpdateAsync(IEnumerable<Entity> entities, CallSettings callSettings = null)

Updates a collection of entities, non-transactionally and asynchronously.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `entities` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity` The entities to update. Must not be null or contain null entries. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous operation. |

**Overrides** [DatastoreDb.UpdateAsync(IEnumerable\<Entity\>, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_UpdateAsync_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Entity__Google_Api_Gax_Grpc_CallSettings_) **Remarks** Datastore limits the number of entities that can be modified in a Commit operation. Although this method does not
use an existing transaction, it still performs all the work in a single Commit operation. When modifying a large
number of entities, partition the changes into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.

### Upsert(IEnumerable\<Entity\>, CallSettings)

    public override IReadOnlyList<Key> Upsert(IEnumerable<Entity> entities, CallSettings callSettings = null)

Upserts a collection of entities, non-transactionally.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `entities` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity` The entities to upsert. Must not be null or contain null entries. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Key` | A collection of allocated keys, in the same order as `entities`. Each inserted entity which had an incomplete key - requiring the server to allocate a new key - will have a non-null value in the collection, equal to the new key for the entity. Each updated entity or inserted entity with a predefined key will have a null value in the collection. |

**Overrides** [DatastoreDb.Upsert(IEnumerable\<Entity\>, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_Upsert_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Entity__Google_Api_Gax_Grpc_CallSettings_) **Remarks** On success, any entities with incomplete keys will be updated in memory with the server-allocated keys.

Datastore limits the number of entities that can be modified in a Commit operation. Although this method does not
use an existing transaction, it still performs all the work in a single Commit operation. When modifying a large
number of entities, partition the changes into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.

### UpsertAsync(IEnumerable\<Entity\>, CallSettings)

    public override Task<IReadOnlyList<Key>> UpsertAsync(IEnumerable<Entity> entities, CallSettings callSettings = null)

Upserts a collection of entities, non-transactionally and asynchronously.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `entities` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity` The entities to upsert. Must not be null or contain null entries. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Key` | A task representing the asynchronous operation. The result of the task is a collection of allocated keys, in the same order as `entities`. Each inserted entity which had an incomplete key - requiring the server to allocate a new key - will have a non-null value in the collection, equal to the new key for the entity. Each updated entity or inserted entity with a predefined key will have a null value in the collection. |

**Overrides** [DatastoreDb.UpsertAsync(IEnumerable\<Entity\>, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreDb#Google_Cloud_Datastore_V1_DatastoreDb_UpsertAsync_System_Collections_Generic_IEnumerable_Google_Cloud_Datastore_V1_Entity__Google_Api_Gax_Grpc_CallSettings_) **Remarks** On success, any entities with incomplete keys will be updated with the server-allocated keys.

Datastore limits the number of entities that can be modified in a Commit operation. Although this method does not
use an existing transaction, it still performs all the work in a single Commit operation. When modifying a large
number of entities, partition the changes into batches. See
[Datastore limits](https://cloud.google.com/datastore/docs/concepts/limits) for more details on Datastore limits.