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

ContextualType

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

Gets the type's base type

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).

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).

public ContextualFieldInfo GetField(string fieldName)

Gets a contextual field of the given contextual type (preserving the context).

public ContextualPropertyInfo GetProperty(string propertyName)

Gets a contextual property of the given contextual type (preserving the context).