AtsContext
Class sealed net8.0
Contains all scanned types, capabilities, and metadata from ATS assembly scanning.
namespace Aspire.TypeSystem;
public sealed class AtsContext{ // ...} 10 members
Remarks
Section titled RemarksThe ATS type system has four distinct categories of exported metadata, 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. - Exported Values (
AtsContext.ExportedValues) — Immutable values marked with[AspireValue]. These are snapped during scanning and emitted as predefined value catalogs in generated guest SDKs.
Constructors1
Section titled ConstructorsProperties8
Section titled PropertiesCapabilitiesget; 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.
ExportedValuesget; init Gets the exported immutable values discovered during scanning.
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.
MethodsgetDictionary<string, MethodInfo> Runtime registry mapping capability IDs to methods.
PropertiesgetDictionary<string, PropertyInfo> Runtime registry mapping capability IDs to properties.