PostSharpAPI ReferencePost­Sharp.​Patterns.​Diagnostics.​Transactions.​ModelTransaction­Policy­Expression­FunctionsRandom
Open sandboxFocus

TransactionPolicyExpressionFunctions.Random Method

Random(Double)

Returns true randomly, with a chance given by the threshold.

Declaration
public static bool Random(double threshold)
Parameters
Type Name Description
Double threshold

Returns true with this probability. For example, if threshold is 0.54, then this method returns true with probability 54%.

Returns
Type Description
Boolean
Remarks

This function is only available in the Sample expression.