Open sandboxFocus

Class ContractContext

Represents the context in which a ContractBaseAttribute is used, i.e. its target declaration and Options.

Inheritance
ContractContext
Namespace: Metalama.Patterns.Contracts
Assembly: Metalama.Patterns.Contracts.dll
Syntax
[CompileTime]
public sealed class ContractContext

Constructors

Name Description
ContractContext(IMetaTarget)
ContractContext(IDeclaration, ContractDirection)

Properties

Name Description
Direction

Gets the ContractDirection.

Options

Gets the application options.

TargetDeclaration

Gets the declaration (parameter, field or property) validated by the contract.

TargetDisplayName

Gets the display name of the TargetDeclaration.

TargetParameterName

Gets the name of the target parameter, or value if the target declaration is a property.

Type

Gets the type of the TargetDeclaration.