Click or drag to resize
DatabaseConnectionTryRunInTransactionT Method (IDatabaseConnection, FuncIDatabaseConnection, T, T)
Runs the function f in a transaction and returns the function result. If the database is not currently in a transaction, a new transaction is created using BeginTransaction with TransactionMode.Deferred and committed. Otherwise the transaction is created within a savepoint block but not fully committed to the database until the enclosing transaction is committed.

Namespace: SQLitePCL.pretty
Assembly: SQLitePCL.pretty (in SQLitePCL.pretty.dll) Version: 1.0.0.0 (1.0.0)
Syntax
public static bool TryRunInTransaction<T>(
	this IDatabaseConnection This,
	Func<IDatabaseConnection, T> f,
	out T result
)

Parameters

This
Type: SQLitePCL.prettyIDatabaseConnection
The database connection.
f
Type: SystemFuncIDatabaseConnection, T
F.
result
Type: T
The function result.

Type Parameters

T
The result type.

Return Value

Type: Boolean
true, if the transaction was committed or released false if it was rolledback.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IDatabaseConnection. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also