MetalamaAPI documentationAspect APIMetalama.​Framework.​ValidationReference­Validation­Context
Open sandboxFocus

ReferenceValidationContext Class

The context object passed to the single parameter of validators added using ValidateReferences<TValidator>(Func<TDeclaration, TValidator>).

Inheritance
ReferenceValidationContext
Namespace: Metalama.Framework.Validation
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public sealed class ReferenceValidationContext : ValueType

Properties

Name Description
AspectState

Gets the optional opaque object defined by the aspect for the specific target declaration using the AspectState property of the IAspectBuilder interface.

DiagnosticLocation

Gets the location on which the diagnostic should be reported.

Diagnostics
ReferencedDeclaration

Gets the declaration being validated (i.e. the one referenced by the Source being inspected).

ReferenceKinds

Gets the set (bit mask) of reference kinds for the current Source. For instance, while validating a parameter of type Foo[], both bits ParameterType and ArrayType will be set.

ReferencingDeclaration

Gets the declaration containing the reference.

ReferencingType

Gets the type containing the reference.

Source

Gets the syntax node that represents the reference.

Syntax

See Also