PostSharp 6.9 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Transactions.​Model Namespace / Policy­Configuration­Model Class

PolicyConfigurationModel Class

Type the source XmL element. The parent of the source element is verbosity (see VerbosityConfigurationModel).
Inheritance Hierarchy

Namespace:  PostSharp.Patterns.Diagnostics.Transactions.Model
Assembly:  PostSharp.Patterns.Diagnostics.Configuration (in PostSharp.Patterns.Diagnostics.Configuration.dll) Version: (
public sealed class PolicyConfigurationModel

The PolicyConfigurationModel type exposes the following members.

Public propertyIf
A C# predicate mapping a parameter t to a bool that determines whether the current policy matches the transaction t. The type of t is OpenTransactionExpressionModel<T>, which is a generic type. The generic type argument, and the type of the Request property, depends on the type of transaction, i.e. on the Type attribute. When the transaction type is AspNetCoreRequest, the expression model type is AspNetCoreRequestExpressionModel. In case of custom transactions, the type is the value of the expression model specified in the LogEventMetadata. This expression can call Matches(String, String) to evaluate a regular expression.
Public propertyName
Name of the policy. Optional. It is useful only for debugging.
Public propertySample
A C# predicate mapping a parameter t to a bool that determines whether the current transaction, after it has been matched by the If predicate, must actually be logged or not. This attribute typically contains a call to Random(Double) or OnceEveryXSeconds(Double, String).
Public propertyType
Type of the transactions matched by this policy. The only supported type is AspNetCoreRequest. For custom transactions, this property must match the name of the LogEventMetadata that describes the transaction.
This class should not be used in any code. It is only mentioned for the sake of documenting the XML file.
See Also