# AtsContext

- Kind: `class`
- Package: [Aspire.TypeSystem](/reference/api/csharp/aspire.typesystem.md)
- Version: `13.4.0`
- Namespace: `Aspire.TypeSystem`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsContext.cs)

Contains all scanned types, capabilities, and metadata from ATS assembly scanning.

## Definition

```csharp
namespace Aspire.TypeSystem;

public sealed class AtsContext
{
    // ...
}
```

## Remarks

The ATS type system has four distinct categories of exported metadata, each with different serialization and code generation behavior:

- **Handle Types ( [AtsContext.HandleTypes](/reference/api/csharp/aspire.typesystem/atscontext/properties.md#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](/reference/api/csharp/aspire.typesystem/atscontext/properties.md#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](/reference/api/csharp/aspire.typesystem/atscontext/properties.md#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](/reference/api/csharp/aspire.typesystem/atscontext/properties.md#exportedvalues))** -- Immutable values marked with `[AspireValue]`. These are snapped during scanning and emitted as predefined value catalogs in generated guest SDKs.

## Constructors

- [AtsContext](/reference/api/csharp/aspire.typesystem/atscontext/constructors.md#constructor)

## Properties

- [Capabilities](/reference/api/csharp/aspire.typesystem/atscontext/properties.md#capabilities) : [IReadOnlyList<AtsCapabilityInfo>](/reference/api/csharp/aspire.typesystem/atscapabilityinfo.md) `get; init` -- Gets the capabilities discovered during scanning. Capabilities are methods or properties marked with [AspireExport] that can be invoked via RPC.
- [Diagnostics](/reference/api/csharp/aspire.typesystem/atscontext/properties.md#diagnostics) : [IReadOnlyList<AtsDiagnostic>](/reference/api/csharp/aspire.typesystem/atsdiagnostic.md) `get; init` -- Gets any diagnostics (warnings/errors) generated during scanning.
- [DtoTypes](/reference/api/csharp/aspire.typesystem/atscontext/properties.md#dtotypes) : [IReadOnlyList<AtsDtoTypeInfo>](/reference/api/csharp/aspire.typesystem/atsdtotypeinfo.md) `get; 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.
- [EnumTypes](/reference/api/csharp/aspire.typesystem/atscontext/properties.md#enumtypes) : [IReadOnlyList<AtsEnumTypeInfo>](/reference/api/csharp/aspire.typesystem/atsenumtypeinfo.md) `get; 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.
- [ExportedValues](/reference/api/csharp/aspire.typesystem/atscontext/properties.md#exportedvalues) : [IReadOnlyList<AtsExportedValueInfo>](/reference/api/csharp/aspire.typesystem/atsexportedvalueinfo.md) `get; init` -- Gets the exported immutable values discovered during scanning.
- [HandleTypes](/reference/api/csharp/aspire.typesystem/atscontext/properties.md#handletypes) : [IReadOnlyList<AtsTypeInfo>](/reference/api/csharp/aspire.typesystem/atstypeinfo.md) `get; 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.
- [Methods](/reference/api/csharp/aspire.typesystem/atscontext/properties.md#methods) : `Dictionary<string, MethodInfo>` `get` -- Runtime registry mapping capability IDs to methods.
- [Properties](/reference/api/csharp/aspire.typesystem/atscontext/properties.md#properties) : `Dictionary<string, PropertyInfo>` `get` -- Runtime registry mapping capability IDs to properties.

## Methods

- [GetCategory(Type)](/reference/api/csharp/aspire.typesystem/atscontext/methods.md#getcategory-type) : [AtsTypeCategory](/reference/api/csharp/aspire.typesystem/atstypecategory.md) -- Gets the type category for a CLR type based on scanned data. Used at runtime for marshalling.
