MetalamaAPI documentationPatterns APIMetalama.​Patterns.​ContractsNot­Null­Attribute
Open sandboxFocus

NotNullAttribute Class

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

Inheritance
System.Object
NotNullAttribute
Namespace: Metalama.Patterns.Contracts
Assembly: Metalama.Patterns.Contracts.dll
Syntax
public sealed class NotNullAttribute : ContractBaseAttribute, IAspect<IParameter>, IEligible<IParameter>, IAspect<IFieldOrPropertyOrIndexer>, IEligible<IFieldOrPropertyOrIndexer>, IConditionallyInheritableAspect, IAspect, ICompileTimeSerializable, ITemplateProvider

Constructors

Name Description
NotNullAttribute()

Initializes a new instance of the NotNullAttribute class.

Methods

Name Description
BuildAspect(IAspectBuilder<IFieldOrPropertyOrIndexer>)
BuildAspect(IAspectBuilder<IParameter>)
BuildEligibility(IEligibilityBuilder<IFieldOrPropertyOrIndexer>)
BuildEligibility(IEligibilityBuilder<IParameter>)
Validate(Object)