PublicApiNamedTypeReference Class

A reference to a class, struct, interface, enum or delegate, optionally constructed with type arguments.

public sealed class PublicApiNamedTypeReference : PublicApiTypeReference

Remarks

A nested type references its containing type through PublicApiNamedTypeReference.ContainingType. Each level only holds its own type arguments, so Outer<string>.Inner<int> has int as type argument and a containing type constructed with string. Primitive types, such as int or string, are represented by their System type.

Inheritance
PublicApiTypeReference PublicApiNamedTypeReference

Properties

NameDescription
AssemblyNameGets the simple name of the assembly that declares the type, as referenced by the inspected assembly. It is null when the assembly cannot be determined from metadata, for instance for a type name serialized in an attribute without an assembly name.
ContainingTypeGets the containing type when the referenced type is nested.
DocumentationIdGets the XML documentation ID of the referenced type definition (e.g. T:System.Collections.Generic.List`1).
FullNameGets the metadata full name of the referenced type definition, using + to separate nested types (e.g. System.Collections.Generic.Dictionary`2+Enumerator).
IsNullableValueTypeGets a value indicating whether the type is a constructed Nullable<T>.
IsTupleTypeGets a value indicating whether the type is a constructed ValueTuple.
IsValueTypeGets a value indicating whether the signature encodes the type as a value type.
Kind
MetadataNameGets the metadata name of the type, including the generic arity suffix (e.g. List`1).
NameGets the name of the type, without the generic arity suffix (e.g. List).
NamespaceGets the namespace of the type. It is empty for nested types and for types of the global namespace.
TupleElementNamesGets the element names of a tuple type. It is empty when the type is not a tuple or when its elements are not named. Unnamed elements are null.
TypeArgumentsGets the type arguments declared at this nesting level. It is empty for non-generic types.

Gets the simple name of the assembly that declares the type, as referenced by the inspected assembly. It is null when the assembly cannot be determined from metadata, for instance for a type name serialized in an attribute without an assembly name.

public string? AssemblyName { get; }

Property value

string?

Gets the containing type when the referenced type is nested.

public PublicApiNamedTypeReference? ContainingType { get; }

Gets the XML documentation ID of the referenced type definition (e.g. T:System.Collections.Generic.List`1).

public string DocumentationId { get; }

Property value

string

Gets the metadata full name of the referenced type definition, using + to separate nested types (e.g. System.Collections.Generic.Dictionary`2+Enumerator).

public string FullName { get; }

Property value

string

Gets a value indicating whether the type is a constructed Nullable<T>.

public bool IsNullableValueType { get; }

Property value

bool

Gets a value indicating whether the type is a constructed ValueTuple.

public bool IsTupleType { get; }

Property value

bool

Gets a value indicating whether the signature encodes the type as a value type.

public bool IsValueType { get; }

Property value

bool

public override PublicApiTypeReferenceKind Kind { get; }

No documentation is available.

Gets the metadata name of the type, including the generic arity suffix (e.g. List`1).

public string MetadataName { get; }

Property value

string

Gets the name of the type, without the generic arity suffix (e.g. List).

public string Name { get; }

Property value

string

Gets the namespace of the type. It is empty for nested types and for types of the global namespace.

public string Namespace { get; }

Property value

string

Gets the element names of a tuple type. It is empty when the type is not a tuple or when its elements are not named. Unnamed elements are null.

public ImmutableArray<string?> TupleElementNames { get; }

Property value

ImmutableArray<string?>

Remarks

For tuples of more than 7 elements, the names of the remaining elements are stored on the nested TRest type argument.

Gets the type arguments declared at this nesting level. It is empty for non-generic types.

public ImmutableArray<PublicApiTypeReference> TypeArguments { get; }