Open sandboxFocus

Class ContractBaseAttribute

A base class for all contracts defined in this library.

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

Constructors

Name Description
ContractBaseAttribute()

Properties

Name Description
Direction

Gets or sets the direction of the contract. When this property is not set, its default value is read from ContractOptions. When no value is defined in ContractOptions, the default value of this property is Default.

IsInheritable

Gets or sets a value indicating whether this contract should be inherited to derived types or overriding members. When this property is not set, its default value is read from ContractOptions. When no value is defined in ContractOptions, the default value of this property is true.

Methods

Name Description
GetActualDirection(IAspectBuilder, ContractDirection)

Gets the actual direction of the contract given the direction returned by GetDefinedDirection(IAspectBuilder), after resolving the Default value according to the characteristics of the target declaration, and after taking predecessors and secondary instances into account. The implementation of this method may return None to skip the aspect.

GetDefinedDirection(IAspectBuilder)

Gets or sets the direction of the data flow (Input, Output or Both) to which this contract applies, as defined by the current aspect. This method returns Default by default. When this method returns Default, the actual direction is determined according to the characteristics of the target declaration.