Metalama 1.0 / / Metalama Documentation / Aspect API / Metalama.​Framework.​Validation / Reference­Validation­Context

Class ReferenceValidationContext

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 Syntax being inspected).

ReferenceKinds

Gets the set (bit mask) of reference kinds for the current Syntax. 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.

Syntax

Gets the syntax node that represents the reference.

See Also