Skip to end of metadata
Go to start of metadata

Represents asynchronus SQLite table query.

Definition

public class AsyncTableQuery<T> : IAsyncTableQuery<T>

where T : new()

Type Parameters

T

Summary

The following table summarizes the members exposed in this class.

Public Constructors

AsyncTableQuery<T> Constructor(ITableQuery<T>) Initializes a new instance of the AsyncTableQuery<T> class.

Public Methods

CountAsync() Gets item counts asynchronously.
CountAsync(CancellationToken)
Deferred() Deferres the query.
Distinct() Distincts the query.
ElementAtAsync(int) Gets the item at specified index.
ElementAtOrDefaultAsync(int) Gets the item at specified index, or a default value if the query contains no items.
FirstAsync() Gets the first item asynchronously.
FirstAsync(Expression<Func<T, bool>>) Gets the first item asynchronously that satisfies the specified condition.
FirstOrDefaultAsync() Gets the first item, or a default value if the query contains no items.
FirstOrDefaultAsync(Expression<Func<T, bool>>) Gets the first item that satisfies the specified condition, or a default value if the query contains no items.
Include(string) Includes the specified table in the query.
OrderBy<U>(Expression<Func<T, U>>) Sort the items in ascending order based on a predicate.
OrderBy(SortDescriptorCollection) Sort the items in ascending order based on specified sort descriptors.
OrderBy(SortDescriptor) Sort the items in ascending order based on specified sort descriptor.
OrderByDescending<U>(Expression<Func<T, U>>) Sort the items in descending order based on a predicate.
Parse(QueryDescriptor) Parses the specified query descriptor to a table query.
SingleAsync() Gets a single item.
SingleAsync(Expression<Func<T, bool>>) Gets a single item that satisfies the specified condition.
SingleOrDefaultAsync() Gets a single item, or a default value if the query contains no items.
SingleOrDefaultAsync(Expression<Func<T, bool>>) Gets a single item that satisfies the specified condition, or a default value if the query contains no items.
Skip(int) Bypasses a specified number of items in a sequence and then returns the remaining items.
Take(int) Returns a specified number of contiguous items from the start of a sequence.
ToArrayAsync() Execute and return the query result.
ToArrayAsync(QueryDescriptor) Execute and return the query result.
ToListAsync() Execute and return the query result.
ToListAsync(CancellationToken) Execute and return the query result.
Where(Expression<Func<T, bool>>) Filters a sequence of items based on a predicate.
Where(IEnumerable<IFilterDescriptor>) Filters a sequence of items based on specified filter descriptors.
Where(CompositeFilterDescriptorCollection) Filters a sequence of items based on specified filter descriptors.
With(Expression`1[]) Return query with specified "with column".

Public Constructors

public AsyncTableQuery(ITableQuery<T> innerQuery)

Initializes a new instance of the AsyncTableQuery<T> class.

Parameters

innerQuery The inner query.

Public Methods

public Task<int> CountAsync()

Gets item counts asynchronously.

public Task<int> CountAsync(CancellationToken cancelToken)

Parameters

cancelToken

public IAsyncTableQuery<T> Deferred()

Deferres the query.

public IAsyncTableQuery<T> Distinct()

Distincts the query.

public Task<T> ElementAtAsync(int index)

Gets the item at specified index.

Parameters

index The index.

public Task<T> ElementAtOrDefaultAsync(int index)

Gets the item at specified index, or a default value if the query contains no items.

Parameters

index The index.

public Task<T> FirstAsync()

Gets the first item asynchronously.

public Task<T> FirstAsync(Expression<Func<T, bool>> predicate)

Gets the first item asynchronously that satisfies the specified condition.

Parameters

predicate The condition.

public Task<T> FirstOrDefaultAsync()

Gets the first item, or a default value if the query contains no items.

public Task<T> FirstOrDefaultAsync(Expression<Func<T, bool>> predicate)

Gets the first item that satisfies the specified condition, or a default value if the query contains no items.

Parameters

predicate The condition.

public IAsyncTableQuery<T> Include(string include)

Includes the specified table in the query.

Parameters

include The table to be included.

public IOrderedAsyncTableQuery<T> OrderBy<U>(Expression<Func<T, U>> orderExpression)

Sort the items in ascending order based on a predicate.

Type Parameters

U The type of the entity.

Parameters

orderExpression The order expression.

public IOrderedAsyncTableQuery<T> OrderBy(SortDescriptorCollection sortDescriptors)

Sort the items in ascending order based on specified sort descriptors.

Parameters

sortDescriptors The sort descriptors.

public IOrderedAsyncTableQuery<T> OrderBy(SortDescriptor sortDescriptor)

Sort the items in ascending order based on specified sort descriptor.

Parameters

sortDescriptor The sort descriptor.

public IOrderedAsyncTableQuery<T> OrderByDescending<U>(Expression<Func<T, U>> orderExpression)

Sort the items in descending order based on a predicate.

Type Parameters

U The type of the entity.

Parameters

orderExpression The order expression.

public IAsyncTableQuery<T> Parse(QueryDescriptor queryDescriptor)

Parses the specified query descriptor to a table query.

Parameters

queryDescriptor The query descriptor.

public Task<T> SingleAsync()

Gets a single item.

public Task<T> SingleAsync(Expression<Func<T, bool>> predicate)

Gets a single item that satisfies the specified condition.

Parameters

predicate The condition.

public Task<T> SingleOrDefaultAsync()

Gets a single item, or a default value if the query contains no items.

public Task<T> SingleOrDefaultAsync(Expression<Func<T, bool>> predicate)

Gets a single item that satisfies the specified condition, or a default value if the query contains no items.

Parameters

predicate The predicate.

public IAsyncTableQuery<T> Skip(int n)

Bypasses a specified number of items in a sequence and then returns the remaining items.

Parameters

n The number of elements to skip before returning the remaining elements.

public IAsyncTableQuery<T> Take(int n)

Returns a specified number of contiguous items from the start of a sequence.

Parameters

n The number of items to return.

public Task<Object[]> ToArrayAsync()

Execute and return the query result.

public Task<Object[]> ToArrayAsync(QueryDescriptor queryDescriptor)

Execute and return the query result.

Parameters

queryDescriptor The query descriptor.

public Task<List<T>> ToListAsync()

Execute and return the query result.

public Task<List<T>> ToListAsync(CancellationToken cancelToken)

Execute and return the query result.

Parameters

cancelToken

public IAsyncTableQuery<T> Where(Expression<Func<T, bool>> predicateExpression)

Filters a sequence of items based on a predicate.

Parameters

predicateExpression The predicate expression.

public IAsyncTableQuery<T> Where(IEnumerable<IFilterDescriptor> filterDescriptors)

Filters a sequence of items based on specified filter descriptors.

Parameters

filterDescriptors The filter descriptors.

public IAsyncTableQuery<T> Where(CompositeFilterDescriptorCollection filterDescriptors)

Filters a sequence of items based on specified filter descriptors.

Parameters

filterDescriptors The filter descriptors.

public IAsyncTableQuery<T> With(Expression`1[] expressions)

Return query with specified "with column".

Parameters

expressions The with column expressions.
  • No labels