Skip to content
Docs Try Aspire
Docs Try

AtsTypeRef Properties

Class Properties 15 members
Lightweight type reference with category and interface flag. Used for parameter types and return types in capabilities.
Gets or sets the immediate base type of this type.
public AtsTypeRef? BaseType { get; init; }
Pre-computed during type scanning so generators can traverse the type hierarchy from the shared ATS model without performing additional reflection. Currently used by Python code generation when mapping inherited members. Returns null for interface types or for types with no relevant base class.
Gets or sets the type category (Primitive, Handle, Dto, Callback, Array, List, Dict, Unknown). Note: This is mutable to allow Pass 2 resolution of Unknown types to Handle.
public AtsTypeCategory Category { get; set; }
ClrType Section titled ClrType nullable Type?
Gets or sets the CLR type reference for direct type access.
public Type? ClrType { get; init; }
Gets or sets the element type reference for Array/List types.
public AtsTypeRef? ElementType { get; init; }
Gets or sets the interfaces this type implements.
public IReadOnlyList<AtsTypeRef> ImplementedInterfaces { get; init; }
Pre-computed during type scanning so generators can consume interface information from the shared ATS model without performing additional reflection. Currently used by Python code generation for interface inheritance and capability placement. Only meaningful for Handle category types.
IsDistributedApplication Section titled IsDistributedApplication bool
Gets whether this type is DistributedApplication.
public bool IsDistributedApplication { get; }
IsDistributedApplicationBuilder Section titled IsDistributedApplicationBuilder bool
Gets whether this type is IDistributedApplicationBuilder.
public bool IsDistributedApplicationBuilder { get; }
Gets or sets whether this is an interface type. Only meaningful for Handle category types.
public bool IsInterface { get; init; }
IsNullable Section titled IsNullable nullable bool?
Gets or sets whether this type reference accepts a JSON null value at its current use site.
public bool? IsNullable { get; init; }
Nullability is attached to the type reference as it appears in a capability or DTO property. Nested element, key, and value type nullability is only represented when those nested references were scanned from member metadata that exposes nullability information. For example, a DTO property declared as
string?
produces a nullable string type reference, while the same CLR String type on a non-nullable property does not.
Gets or sets whether this is a readonly collection (copied, not a handle). Only meaningful for Array/Dict categories.
public bool IsReadOnly { get; init; }
IsResourceBuilder Section titled IsResourceBuilder bool
Gets whether this type represents a resource builder target type. Computed from ClrType - true for types that implement the Aspire resource contract.
public bool IsResourceBuilder { get; }
Gets or sets the key type reference for Dict types.
public AtsTypeRef? KeyType { get; init; }
Gets or sets the ATS type ID (e.g., "string", "Aspire.Hosting/RedisResource").
public string TypeId { get; init; }
Gets or sets the member types for Union category. When Category = Union, this contains the alternative types.
public IReadOnlyList<AtsTypeRef>? UnionTypes { get; init; }
Gets or sets the value type reference for Dict types.
public AtsTypeRef? ValueType { get; init; }