# ConnectionPropertyAnnotation Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ConnectionPropertyAnnotation](/reference/api/csharp/aspire.hosting/connectionpropertyannotation.md)
- Kind: `Constructors`
- Members: `1`

Annotation that creates a custom connection property value injected into environment variables when a resource is referenced using `WithReference()`.

## ConnectionPropertyAnnotation(string, ReferenceExpression)

- Name: `Constructor(string, ReferenceExpression)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ConnectionPropertyAnnotation.cs#L18-L22)

Initializes a new instance of the ConnectionPropertyAnnotation class with the specified property name and reference expression.

```csharp
public sealed class ConnectionPropertyAnnotation
{
    public ConnectionPropertyAnnotation(
        string name,
        ReferenceExpression referenceExpression)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the connection property to annotate. Cannot be null or empty.
- `referenceExpression` ([ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md))
  The reference expression associated with the connection property. Cannot be null.
