Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Contracts Namespace / Location­Contract­Attribute Class / Location­Contract­Attribute Methods / Location­Contract­Attribute.​Create­Argument­Out­Of­Range­Exception Method

LocationContractAttribute.CreateArgumentOutOfRangeException Method

Creates an ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values.

Namespace:  PostSharp.Patterns.Contracts
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 5.0.43.0 (5.0.43.0)
Syntax
C#
protected ArgumentOutOfRangeException CreateArgumentOutOfRangeException(
	Object value,
	string locationName,
	LocationKind locationKind
)

Parameters

value
Type: System.Object
Value assigned to the location.
locationName
Type: System.String
Name of the location.
locationKind
Type: PostSharp.Reflection.LocationKind
Location kind.

Return Value

Type: ArgumentOutOfRangeException
A new ArgumentOutOfRangeException where the message, has been derived from ErrorMessage, with placeholders replaced by their concrete value.
See Also