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

ContextualTypeExtensions

public static class ContextualTypeExtensions
Type and member extension methods to extract contextual or cached types.

Gets an enumerable of ContextualAccessorInfos (all properties and fields) for the given Type instance.

public static ContextualFieldInfo[] GetContextualFields(this Type type)

Gets an array of ContextualFieldInfo for the given Type instance.

Gets an array of ContextualPropertyInfo for the given Type instance.

public static CachedType ToCachedType(this Type type)

Gets a CachedType for the given Type instance.

Gets a ContextualMemberInfo for the given MemberInfo instance. Warning: Retrieving contextual information directly from MemberInfo might lose original context data (NRT on original generic type parameters).

public static ContextualFieldInfo ToContextualField(this FieldInfo fieldInfo)

Gets a ContextualFieldInfo for the given FieldInfo instance. Warning: Retrieving contextual information directly from FieldInfo might lose original context data (NRT on original generic type parameters).

Gets a ContextualParameterInfo for the given ParameterInfo instance. Warning: Retrieving contextual information directly from ParameterInfo might lose original context data (NRT on original generic type parameters).

public static ContextualPropertyInfo ToContextualProperty(this PropertyInfo propertyInfo)

Gets a ContextualPropertyInfo for the given PropertyInfo instance. Warning: Retrieving contextual information directly from PropertyInfo might lose original context data (NRT on original generic type parameters).

public static ContextualType ToContextualType(this Type type)

Gets a CachedType for the given Type instance.

public static ContextualType ToContextualType(this Type type, IEnumerable<Attribute> attributes)

Gets an uncached ContextualType for the given Type instance and attributes.