Class Extensions
Extension methods with more convenient overloads for using options and configuration.
Inherited Members
Namespace: Couchbase.Transactions.Config
Assembly: Couchbase.Transactions.dll
Syntax
public static class Extensions
Methods
| Improve this Doc View SourceQueryAsync<T>(AttemptContext, String, Action<TransactionQueryOptions>, IScope)
Run a query in transaction mode.
Declaration
public static async Task<IQueryResult<T>> QueryAsync<T>(this AttemptContext ctx, string statement, Action<TransactionQueryOptions> configure, IScope scope = null)
Parameters
Type | Name | Description |
---|---|---|
AttemptContext | ctx | |
String | statement | The statement to execute. |
Action<TransactionQueryOptions> | configure | An action to configure the options for this query. |
Couchbase.KeyValue.IScope | scope | The scope |
Returns
Type | Description |
---|---|
Task<Couchbase.Query.IQueryResult<T>> | A SingleQueryTransactionResult<T> with the query results, if any. |
Type Parameters
Name | Description |
---|---|
T | The type of the result. Use Object for queries with no results. |
Remarks
IMPORTANT: Any KV operations after this query will be run via the query engine, which has performance implications.
QueryAsync<T>(Transactions, String, Action<SingleQueryTransactionConfigBuilder>, IScope)
Run a single query as a transaction.
Declaration
public static async Task<SingleQueryTransactionResult<T>> QueryAsync<T>(this Transactions transactions, string statement, Action<SingleQueryTransactionConfigBuilder> configure = null, IScope scope = null)
Parameters
Type | Name | Description |
---|---|---|
Transactions | transactions | |
String | statement | The statement to execute. |
Action<SingleQueryTransactionConfigBuilder> | configure | An action to configure this transaction. |
Couchbase.KeyValue.IScope | scope | The scope |
Returns
Type | Description |
---|---|
Task<SingleQueryTransactionResult<T>> | A SingleQueryTransactionResult<T> with the query results, if any. |
Type Parameters
Name | Description |
---|---|
T | The type of the result. Use Object for queries with no results. |
QueryConfig(TransactionConfigBuilder, Action<TransactionQueryConfigBuilder>)
Configuration builder for values related to Query.
Declaration
public static TransactionConfigBuilder QueryConfig(this TransactionConfigBuilder config, Action<TransactionQueryConfigBuilder> configure)
Parameters
Type | Name | Description |
---|---|---|
TransactionConfigBuilder | config | |
Action<TransactionQueryConfigBuilder> | configure | An action to invoke the TransactionQueryConfigBuilder to configure query options for transactions. |
Returns
Type | Description |
---|---|
TransactionConfigBuilder | The original TransactionConfigBuilder. |