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

CachedType

public class CachedType
A cached type object without context.
public virtual IEnumerable<Attribute> Attributes { get; }

Gets all type attributes.

public CachedType ElementType { get; }

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

public CachedType[] GenericArguments { get; }

Gets the type's generic arguments (Nullable{T} is unwrapped).

public Attribute[] InheritedAttributes { get; }

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

public bool IsNullableType { get; }

Gets a value indicating whether this type is wrapped with Nullable{T}.

Gets the type's original generic arguments (Nullable{T} is not unwrapped).

public Type OriginalType { get; }

Gets the original type (i.e. without unwrapping Nullable{T}).

public Type Type { get; }

Gets the actual unwrapped type (e.g. gets T of a Nullable{T} type).

public Type TypeInfo { get; }

Gest the original's type info.

public string TypeName { get; }

Gets the type name.

public static void ClearCache()

Clears the cache.

public static Type op_Implicit(CachedType type)

Unwraps the OriginalType as Type from the context type.

protected virtual CachedType GetCachedType(Type type, ref int nullableFlagsIndex)

Gets the cached type for the given type and nullable flags index.

public T GetInheritedAttribute<T>() where T : Attribute

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

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

Updates the original generic arguments.

protected void UpdateOriginalGenericArguments(ref int nullableFlagsIndex)

Updates the original generic arguments.