# AspireDtoAttribute Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [AspireDtoAttribute](/reference/api/csharp/aspire.hosting/aspiredtoattribute.md)
- Kind: `Properties`
- Members: `1`

Marks a class as an ATS (Aspire Type System) Data Transfer Object. DTOs are serializable types used to pass structured data to capabilities.

## DtoTypeId

- Name: `DtoTypeId`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/Ats/AspireDtoAttribute.cs)

Gets or sets an optional type identifier for this DTO. If not specified, the DTO will be serialized as a plain JSON object.

```csharp
public string? DtoTypeId { get; set; }
```

## Remarks

When set, the serialized JSON will include a `$type` field with this value.
