<PackageReference Include="Namotion.Reflection" Version="1.0.11" />

ContextualType

public class ContextualType : CachedType
A cached type with context information (e.g. parameter, field, property with nullability).
public Attribute[] ContextAttributes { get; }

Gets the type's associated attributes of the given context (inherited).

public ContextualType ElementType { get; }

Gets the type's element type (i.e. array type).

public ContextualType[] GenericArguments { get; }

Gets the generic type arguments of the type in the given context (empty when unwrapped from Nullable{T}).

public Nullability Nullability { get; }

Gets the nullability information of this type in the given context by unwrapping Nullable{T} into account.

Gets the original generic type arguments of the type in the given context.

Gets the original nullability information of this type in the given context (i.e. without unwrapping Nullable{T}).

public ContextualType Parent { get; }

Gets the parent type with context.

public T GetAttribute<T>()

Gets an attribute of the given type which is defined on the context or on the type.

public IEnumerable<T> GetAttributes<T>()

Gets the attributes of the given type which are defined on the context or on the type.

public T GetContextAttribute<T>()

Gets an attribute of the given type which is defined on the context (property, field, parameter or contextual generic argument type).

Gets the attributes of the given type which are defined on the context (property, field, parameter or contextual generic argument type).