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

ITransactionPolicySelector.GetPolicy Method

GetPolicy(in TransactionProperties, Boolean)

Gets the policy that determines whether an activity should be a logged transaction, and other details about the transaction.

Declaration
ITransactionPolicy GetPolicy(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
ITransactionPolicy

Policy to apply to the activity.

Remarks

This method must ignore any sampling policy since they have already been evaluated by GetTransactionRequirement(in TransactionProperties, Boolean).