PostSharpAPI ReferencePost­Sharp.​Patterns.​ContractsNot­Null­Attribute
Open sandboxFocus

Class NotNullAttribute

Custom attribute that, when added to a field, property or parameter, throws an ArgumentNullException if the target is assigned a null value.

Inheritance
NotNullAttribute
Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Common.dll
Syntax
[HasConstraint]
public sealed class NotNullAttribute : LocationContractAttribute, ILocationLevelAspect, IAspect

Constructors

Name Description
NotNullAttribute()

Initializes a new ArgumentNullException.

Methods

Name Description
GetErrorMessage()
ValidateValueDynamic(Object, String, LocationKind, LocationValidationContext)