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.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Common.dll
Syntax
public sealed class NotNullAttribute : LocationContractAttribute, ILocationLevelAspect, IAspect
Remarks

Error message is identified by NotNullErrorMessage.

Constructors

Name Description
NotNullAttribute()

Initializes a new ArgumentNullException.

Methods

Name Description
GetErrorMessage()

Gets unformatted error message as defined by the instance.