withTrait

Method
📦 Aspire.Hosting v17.0.0
interface ContainerResource {
// ... omitted for brevity
withTrait(
name: string,
value: string): IResource;
}

Signature

methodwithTraitbuilder
Adds immutable, non-sensitive metadata to a resource. Repeated names add multiple values.
withTrait(
name: string,
value: string): IResource
namestringThe case-sensitive trait name.
valuestringThe trait value. Do not include secrets.
IResource

Applies to

This method applies to the following types: