Click or drag to resize

throwIfThrowIfAbsurd Method (NullableInt32, String, Boolean, Boolean, Boolean, Boolean)

Throw a ArgumentNullException if an int? is not positive or null.

Namespace:  WhetStone.SystemExtensions
Assembly:  WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
public static void ThrowIfAbsurd(
	this Nullable<int> this,
	string paramName = "parameter",
	bool allowZero = true,
	bool allowOne = true,
	bool allowNeg = false,
	bool allowNull = true
)

Parameters

this
Type: SystemNullableInt32
The double to check.
paramName (Optional)
Type: SystemString
The string of the exception to throw. for generic parameter name.
allowZero (Optional)
Type: SystemBoolean
Whether to allow 0.
allowOne (Optional)
Type: SystemBoolean
Whether to allow 1.
allowNeg (Optional)
Type: SystemBoolean
Whether to allow negative values.
allowNull (Optional)
Type: SystemBoolean
Whether to allow null

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type NullableInt32. 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