Class Extensions
Extension methods with more convenient overloads for using options and configuration.
Inherited Members
Namespace: Couchbase.Client.Transactions.Config
Assembly: Couchbase.NetClient.dll
Syntax
public static class Extensions
Methods
| Edit this page View SourceQueryAsync<T>(AttemptContext, string, Action<TransactionQueryOptions>?, IScope?)
Run a query in transaction mode.
Declaration
public static Task<IQueryResult<T>> QueryAsync<T>(this AttemptContext ctx, string statement, Action<TransactionQueryOptions>? configure = null, IScope? scope = null)
Parameters
Type | Name | Description |
---|---|---|
Attempt |
ctx | The AttemptContext to query from. |
string | statement | The statement to execute. |
Action<Transaction |
configure | An action to configure the options for this query. |
IScope | scope | The scope |
Returns
Type | Description |
---|---|
Task<IQuery |
A Single |
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 Task<SingleQueryTransactionResult<T>> QueryAsync<T>(this Transactions transactions, string statement, Action<SingleQueryTransactionConfigBuilder>? configure = null, IScope? scope = null)
Parameters
Type | Name | Description |
---|---|---|
Transactions | transactions | The transactions object to query from. |
string | statement | The statement to execute. |
Action<Single |
configure | An action to configure this transaction. |
IScope | scope | The scope |
Returns
Type | Description |
---|---|
Task<Single |
A Single |
Type Parameters
Name | Description |
---|---|
T | The type of the result. Use object for queries with no results. |
QueryConfig(TransactionsConfigBuilder, Action<TransactionQueryConfigBuilder>?)
Configuration builder for values related to Query.
Declaration
public static TransactionsConfigBuilder QueryConfig(this TransactionsConfigBuilder config, Action<TransactionQueryConfigBuilder>? configure)
Parameters
Type | Name | Description |
---|---|---|
Transactions |
config | The config builder to modify. |
Action<Transaction |
configure | An action to invoke the Transaction |
Returns
Type | Description |
---|---|
Transactions |
The original Transactions |