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

CachedType

public class CachedType
A cached type object without context.
protected object genericArguments

Internal generic arguments.

protected object originalGenericArguments

Internal original generic arguments.

public virtual IEnumerable<Attribute> Attributes { get; }

Gets all type attributes.

public CachedType[] GenericArguments { get; }

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

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 Attribute[] TypeAttributes { get; }

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

public TypeInfo 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 GetTypeAttribute<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.