Open sandboxFocus

Class RequiredAttribute

Custom attribute that, when added to a field, property or parameter, throws:

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

Constructors

Name Description
RequiredAttribute()

Initializes a new instance of the RequiredAttribute class.

Methods

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

Configures the eligibility of the aspect or attribute by defining rules that determine which declarations the aspect can be applied to.

BuildEligibility(IEligibilityBuilder<IParameter>)

Configures the eligibility of the aspect or attribute by defining rules that determine which declarations the aspect can be applied to.

Validate(dynamic?)

The template method that validates or normalizes the value of a field, property, indexer, or parameter.

Extension Methods

See Also