# TraitAnnotation

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `17.0.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/src/Aspire.Hosting/ApplicationModel/TraitAnnotation.cs)
- Implements: [IResourceAnnotation](/reference/api/csharp/aspire.hosting/iresourceannotation.md)

Immutable, non-sensitive metadata attached to a resource. Multiple annotations with the same name represent multiple values.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public sealed class TraitAnnotation
    : Aspire.Hosting.ApplicationModel.IResourceAnnotation
{
    // ...
}
```

## Constructors

- [TraitAnnotation(string, string)](/reference/api/csharp/aspire.hosting/traitannotation/constructors.md#constructor-string-string) -- Creates a resource trait.

## Properties

- [Name](/reference/api/csharp/aspire.hosting/traitannotation/properties.md#name) : `string` `get` -- Gets the case-sensitive trait name.
- [Value](/reference/api/csharp/aspire.hosting/traitannotation/properties.md#value) : `string` `get` -- Gets the trait value.
