PostSharpAPI ReferencePost­Sharp.​Patterns.​Diagnostics.​TransactionsITransaction­Policy­SelectorGet­Transaction­Requirement
Open sandboxFocus

ITransactionPolicySelector.GetTransactionRequirement Method

GetTransactionRequirement(in TransactionProperties, Boolean)

Determines whether an activity should result in opening a transaction.

Declaration
TransactionRequirement GetTransactionRequirement(in TransactionProperties properties, bool throwing = false)
Parameters
Type Name Description
TransactionProperties properties

Properties, especially of the activity that's creating a transaction.

Boolean throwing

true if errors should be reported as exceptions, false if they should be handled without exception. The default is false. The true value is used for debugging and diagnostics.

Returns
Type Description
TransactionRequirement

Policy to apply to the activity.

Remarks

This method must apply sampling policies, if any.