# AtsTypeRef

- 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/AtsCapabilityInfo.cs)

Lightweight type reference with category and interface flag. Used for parameter types and return types in capabilities.

## Definition

```csharp
namespace Aspire.TypeSystem;

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

## Constructors

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

## Properties

- [BaseType](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#basetype) : [AtsTypeRef?](/reference/api/csharp/aspire.typesystem/atstyperef.md) `get; init` -- Gets or sets the immediate base type of this type.
- [Category](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#category) : [AtsTypeCategory](/reference/api/csharp/aspire.typesystem/atstypecategory.md) `get; set` -- 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.
- [ClrType](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#clrtype) : `Type?` `get; init` -- Gets or sets the CLR type reference for direct type access.
- [ElementType](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#elementtype) : [AtsTypeRef?](/reference/api/csharp/aspire.typesystem/atstyperef.md) `get; init` -- Gets or sets the element type reference for Array/List types.
- [ImplementedInterfaces](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#implementedinterfaces) : [IReadOnlyList<AtsTypeRef>](/reference/api/csharp/aspire.typesystem/atstyperef.md) `get; init` -- Gets or sets the interfaces this type implements.
- [IsDistributedApplication](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#isdistributedapplication) : `bool` `get` -- Gets whether this type is DistributedApplication.
- [IsDistributedApplicationBuilder](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#isdistributedapplicationbuilder) : `bool` `get` -- Gets whether this type is IDistributedApplicationBuilder.
- [IsInterface](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#isinterface) : `bool` `get; init` -- Gets or sets whether this is an interface type. Only meaningful for Handle category types.
- [IsNullable](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#isnullable) : `bool?` `get; init` -- Gets or sets whether this type reference accepts a JSON null value at its current use site.
- [IsReadOnly](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#isreadonly) : `bool` `get; init` -- Gets or sets whether this is a readonly collection (copied, not a handle). Only meaningful for Array/Dict categories.
- [IsResourceBuilder](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#isresourcebuilder) : `bool` `get` -- Gets whether this type represents a resource builder target type. Computed from ClrType - true for types that implement the Aspire resource contract.
- [KeyType](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#keytype) : [AtsTypeRef?](/reference/api/csharp/aspire.typesystem/atstyperef.md) `get; init` -- Gets or sets the key type reference for Dict types.
- [TypeId](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#typeid) : `string` `get; init` -- Gets or sets the ATS type ID (e.g., "string", "Aspire.Hosting/RedisResource").
- [UnionTypes](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#uniontypes) : [IReadOnlyList<AtsTypeRef>](/reference/api/csharp/aspire.typesystem/atstyperef.md) `get; init` -- Gets or sets the member types for Union category. When Category = Union, this contains the alternative types.
- [ValueType](/reference/api/csharp/aspire.typesystem/atstyperef/properties.md#valuetype) : [AtsTypeRef?](/reference/api/csharp/aspire.typesystem/atstyperef.md) `get; init` -- Gets or sets the value type reference for Dict types.
