Skip to content
Docs Try Aspire

AtsContext

Class sealed net8.0
📦 Aspire.TypeSystem v13.2.0
Contains all scanned types, capabilities, and metadata from ATS assembly scanning.
namespace Aspire.TypeSystem;
public sealed class AtsContext
{
// ...
}

The ATS type system has three distinct categories of types, each with different serialization and code generation behavior:

  • Handle Types ( AtsContext.HandleTypes) Types marked with [AspireExport]. These are passed by reference using opaque handles. The TypeScript SDK generates wrapper classes that hold handles and proxy method calls back to .NET. Examples: IDistributedApplicationBuilder, ContainerResource, EndpointReference.
  • DTO Types ( AtsContext.DtoTypes) Types marked with [AspireDto]. These are serialized as JSON objects and passed by value. The TypeScript SDK generates interfaces matching the DTO's properties. Examples: CreateBuilderOptions, ResourceSnapshot.
  • Enum Types ( AtsContext.EnumTypes) Enum types discovered in capability signatures. These are serialized as strings. The TypeScript SDK generates TypeScript enums with string values.
View all constructors
Capabilitiesget; init
Gets the capabilities discovered during scanning. Capabilities are methods or properties marked with [AspireExport] that can be invoked via RPC.
Diagnosticsget; init
Gets any diagnostics (warnings/errors) generated during scanning.
DtoTypesget; init
Gets the DTO types discovered during scanning. These are types marked with [AspireDto] that are serialized as JSON objects. Code generators create interfaces for these types.
EnumTypesget; init
Gets the enum types discovered during scanning. These are enum types found in capability signatures, serialized as strings. Code generators create enum definitions for these types.
HandleTypesget; init
Gets the handle types discovered during scanning. These are types marked with [AspireExport] that are passed by reference using opaque handles. Code generators create wrapper classes for these types.
Methodsget
Dictionary<string, MethodInfo>
Runtime registry mapping capability IDs to methods.
Propertiesget
Dictionary<string, PropertyInfo>
Runtime registry mapping capability IDs to properties.
View all properties
GetCategory(Type)
Gets the type category for a CLR type based on scanned data. Used at runtime for marshalling.
View all methods