# AtsConstants Methods

- Package: [Aspire.TypeSystem](/reference/api/csharp/aspire.typesystem.md)
- Type: [AtsConstants](/reference/api/csharp/aspire.typesystem/atsconstants.md)
- Kind: `Methods`
- Members: `14`

Constants for ATS (Aspire Type System) type IDs and capability IDs.

## ArrayTypeId(string)

- Name: `ArrayTypeId(string)`
- Modifiers: `static`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L253)

Creates an array type ID for the given element type.

```csharp
public static class AtsConstants
{
    public static string ArrayTypeId(
        string elementType)
    {
        // ...
    }
}
```

## Parameters

- `elementType` (`string`)
  The element type ID.

## Returns

`string` -- The array type ID.

## DictTypeId(string, string)

- Name: `DictTypeId(string, string)`
- Modifiers: `static`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L268)

Creates a Dict type ID for the given key and value types.

```csharp
public static class AtsConstants
{
    public static string DictTypeId(
        string keyType,
        string valueType)
    {
        // ...
    }
}
```

## Parameters

- `keyType` (`string`)
  The key type ID.
- `valueType` (`string`)
  The value type ID.

## Returns

`string` -- The Dict type ID.

## EnumTypeId(string)

- Name: `EnumTypeId(string)`
- Modifiers: `static`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L275)

Creates an enum type ID for the given enum type full name.

```csharp
public static class AtsConstants
{
    public static string EnumTypeId(
        string enumFullName)
    {
        // ...
    }
}
```

## Parameters

- `enumFullName` (`string`)
  The full name of the enum type.

## Returns

`string` -- The enum type ID.

## GetCategory(string?, bool)

- Name: `GetCategory(string?, bool)`
- Modifiers: `static`
- Returns: [AtsTypeCategory](/reference/api/csharp/aspire.typesystem/atstypecategory.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L354-L389)

Gets the type category for a type ID. Note: This method cannot distinguish DTOs from Handles based on type ID alone. Use the scanner's type mapping to determine if a handle type is actually a DTO.

```csharp
public static class AtsConstants
{
    public static AtsTypeCategory GetCategory(
        string? typeId,
        bool isCallback = false)
    {
        // ...
    }
}
```

## Parameters

- `typeId` (`string?`)
  The ATS type ID.
- `isCallback` (`bool`) `optional`
  True if this is a callback parameter.

## Returns

[AtsTypeCategory](/reference/api/csharp/aspire.typesystem/atstypecategory.md) -- The type category.

## GetCategory(Type)

- Name: `GetCategory(Type)`
- Modifiers: `static`
- Returns: [AtsTypeCategory](/reference/api/csharp/aspire.typesystem/atstypecategory.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L446-L494)

Gets the type category for a CLR type.

```csharp
public static class AtsConstants
{
    public static AtsTypeCategory GetCategory(
        Type type)
    {
        // ...
    }
}
```

## Parameters

- `type` (`Type`)
  The CLR type.

## Returns

[AtsTypeCategory](/reference/api/csharp/aspire.typesystem/atstypecategory.md) -- The type category.

## IsArray(string?)

- Name: `IsArray(string?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L289)

Checks if a type ID represents an array type.

```csharp
public static class AtsConstants
{
    public static bool IsArray(
        string? typeId)
    {
        // ...
    }
}
```

## Parameters

- `typeId` (`string?`)
  The ATS type ID to check.

## Returns

`bool` -- True if the type is an array.

## IsDict(string?)

- Name: `IsDict(string?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L303)

Checks if a type ID represents a Dict type.

```csharp
public static class AtsConstants
{
    public static bool IsDict(
        string? typeId)
    {
        // ...
    }
}
```

## Parameters

- `typeId` (`string?`)
  The ATS type ID to check.

## Returns

`bool` -- True if the type is a Dict.

## IsEnum(string?)

- Name: `IsEnum(string?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L282)

Checks if a type ID represents an enum type.

```csharp
public static class AtsConstants
{
    public static bool IsEnum(
        string? typeId)
    {
        // ...
    }
}
```

## Parameters

- `typeId` (`string?`)
  The ATS type ID to check.

## Returns

`bool` -- True if the type is an enum.

## IsHandle(string?)

- Name: `IsHandle(string?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L329-L341)

Checks if a type ID represents a handle type (has Assembly/Type format).

```csharp
public static class AtsConstants
{
    public static bool IsHandle(
        string? typeId)
    {
        // ...
    }
}
```

## Parameters

- `typeId` (`string?`)
  The ATS type ID to check.

## Returns

`bool` -- True if the type is a handle.

## IsList(string?)

- Name: `IsList(string?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L296)

Checks if a type ID represents a List type.

```csharp
public static class AtsConstants
{
    public static bool IsList(
        string? typeId)
    {
        // ...
    }
}
```

## Parameters

- `typeId` (`string?`)
  The ATS type ID to check.

## Returns

`bool` -- True if the type is a List.

## IsPrimitive(string?)

- Name: `IsPrimitive(string?)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L314-L320)

Checks if a type ID represents a primitive type.

```csharp
public static class AtsConstants
{
    public static bool IsPrimitive(
        string? typeId)
    {
        // ...
    }
}
```

## Parameters

- `typeId` (`string?`)
  The ATS type ID to check.

## Returns

`bool` -- True if the type is a primitive.

## IsPrimitiveType(Type)

- Name: `IsPrimitiveType(Type)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L437)

Checks if a CLR type is a primitive ATS type.

```csharp
public static class AtsConstants
{
    public static bool IsPrimitiveType(
        Type type)
    {
        // ...
    }
}
```

## Parameters

- `type` (`Type`)
  The CLR type to check.

## Returns

`bool` -- True if the type is a primitive.

## IsReadOnlyDictType(Type)

- Name: `IsReadOnlyDictType(Type)`
- Modifiers: `static`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L549-L555)

Checks if a dictionary type is readonly.

```csharp
public static class AtsConstants
{
    public static bool IsReadOnlyDictType(
        Type type)
    {
        // ...
    }
}
```

## Parameters

- `type` (`Type`)

## ListTypeId(string)

- Name: `ListTypeId(string)`
- Modifiers: `static`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.TypeSystem/AtsConstants.cs#L260)

Creates a List type ID for the given element type.

```csharp
public static class AtsConstants
{
    public static string ListTypeId(
        string elementType)
    {
        // ...
    }
}
```

## Parameters

- `elementType` (`string`)
  The element type ID.

## Returns

`string` -- The List type ID.
