TableClient.QueryAsync Method

Definition

Overloads

QueryAsync<T>(Expression<Func<T,Boolean>>, Nullable<Int32>, IEnumerable<String>, CancellationToken)

Queries entities in the table.

QueryAsync<T>(String, Nullable<Int32>, IEnumerable<String>, CancellationToken)

Queries entities in the table.

QueryAsync<T>(Expression<Func<T,Boolean>>, Nullable<Int32>, IEnumerable<String>, CancellationToken)

Source:
TableClient.cs

Queries entities in the table.

public virtual Azure.AsyncPageable<T> QueryAsync<T> (System.Linq.Expressions.Expression<Func<T,bool>> filter, int? maxPerPage = default, System.Collections.Generic.IEnumerable<string> select = default, System.Threading.CancellationToken cancellationToken = default) where T : class, Azure.Data.Tables.ITableEntity;
abstract member QueryAsync : System.Linq.Expressions.Expression<Func<'T, bool>> * Nullable<int> * seq<string> * System.Threading.CancellationToken -> Azure.AsyncPageable<'T (requires 'T : null and 'T :> Azure.Data.Tables.ITableEntity)> (requires 'T : null and 'T :> Azure.Data.Tables.ITableEntity)
override this.QueryAsync : System.Linq.Expressions.Expression<Func<'T, bool>> * Nullable<int> * seq<string> * System.Threading.CancellationToken -> Azure.AsyncPageable<'T (requires 'T : null and 'T :> Azure.Data.Tables.ITableEntity)> (requires 'T : null and 'T :> Azure.Data.Tables.ITableEntity)
Public Overridable Function QueryAsync(Of T As {Class, ITableEntity}) (filter As Expression(Of Func(Of T, Boolean)), Optional maxPerPage As Nullable(Of Integer) = Nothing, Optional select As IEnumerable(Of String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of T)

Type Parameters

T

A custom model type that implements ITableEntity or an instance of TableEntity.

Parameters

filter
Expression<Func<T,Boolean>>

Returns only entities that satisfy the specified filter expression. For example, the following expression would filter entities with a PartitionKey of 'foo': e => e.PartitionKey == "foo".

maxPerPage
Nullable<Int32>

The maximum number of entities that will be returned per page. If unspecified, the default value is 1000 for storage accounts and is not limited for Cosmos DB table API. Note: This value does not limit the total number of results if the result is fully enumerated.

select
IEnumerable<String>

An IEnumerable<T> of entity property names that selects which set of entity properties to return in the result set. For example, the following value would return only the PartitionKey and RowKey properties: new[] { "PartitionKey, RowKey"}.

cancellationToken
CancellationToken

A CancellationToken controlling the request lifetime.

Returns

An AsyncPageable<T> containing a collection of entity models serialized as type T.

Exceptions

The server returned an error. See Message for details returned from the server.

Applies to

QueryAsync<T>(String, Nullable<Int32>, IEnumerable<String>, CancellationToken)

Source:
TableClient.cs

Queries entities in the table.

public virtual Azure.AsyncPageable<T> QueryAsync<T> (string filter = default, int? maxPerPage = default, System.Collections.Generic.IEnumerable<string> select = default, System.Threading.CancellationToken cancellationToken = default) where T : class, Azure.Data.Tables.ITableEntity;
abstract member QueryAsync : string * Nullable<int> * seq<string> * System.Threading.CancellationToken -> Azure.AsyncPageable<'T (requires 'T : null and 'T :> Azure.Data.Tables.ITableEntity)> (requires 'T : null and 'T :> Azure.Data.Tables.ITableEntity)
override this.QueryAsync : string * Nullable<int> * seq<string> * System.Threading.CancellationToken -> Azure.AsyncPageable<'T (requires 'T : null and 'T :> Azure.Data.Tables.ITableEntity)> (requires 'T : null and 'T :> Azure.Data.Tables.ITableEntity)
Public Overridable Function QueryAsync(Of T As {Class, ITableEntity}) (Optional filter As String = Nothing, Optional maxPerPage As Nullable(Of Integer) = Nothing, Optional select As IEnumerable(Of String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of T)

Type Parameters

T

A custom model type that implements ITableEntity or an instance of TableEntity.

Parameters

filter
String

Returns only entities that satisfy the specified OData filter. For example, the following filter would filter entities with a PartitionKey of 'foo': "PartitionKey eq 'foo'".

maxPerPage
Nullable<Int32>

The maximum number of entities that will be returned per page. If unspecified, the default value is 1000 for storage accounts and is not limited for Cosmos DB table API. Note: This value does not limit the total number of results if the result is fully enumerated.

select
IEnumerable<String>

An IEnumerable<T> of entity property names that selects which set of entity properties to return in the result set. For example, the following value would return only the PartitionKey and RowKey properties: new[] { "PartitionKey, RowKey"}.

cancellationToken
CancellationToken

A CancellationToken controlling the request lifetime.

Returns

An AsyncPageable<T> containing a collection of entity models serialized as type T.

Exceptions

The server returned an error. See Message for details returned from the server.

Applies to