# ConnectionPropertiesExtensions Methods

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ConnectionPropertiesExtensions](/reference/api/csharp/aspire.hosting/connectionpropertiesextensions.md)
- Kind: `Methods`
- Members: `1`

Provides extension methods for adding connection properties to resources.

## CombineProperties(IResourceWithConnectionString, IEnumerable<KeyValuePair<string, ReferenceExpression>>)

- Name: `CombineProperties(IResourceWithConnectionString, IEnumerable<KeyValuePair<string, ReferenceExpression>>)`
- Modifiers: `extension`
- Returns: `IEnumerable<KeyValuePair<string, ReferenceExpression>>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ConnectionPropertiesExtensions.cs#L22-L37)

Combines two sets of connection properties, with properties from the additional set overriding those in the source set in case of key conflicts.

```csharp
public static class ConnectionPropertiesExtensions
{
    public static IEnumerable<KeyValuePair<string, ReferenceExpression>> CombineProperties(
        this IResourceWithConnectionString source,
        IEnumerable<KeyValuePair<string, ReferenceExpression>> additional)
    {
        // ...
    }
}
```

## Parameters

- `source` ([IResourceWithConnectionString](/reference/api/csharp/aspire.hosting/iresourcewithconnectionstring.md))
  The resource that exposes the base connection properties.
- `additional` (`IEnumerable<KeyValuePair<string, ReferenceExpression>>`)
  The additional connection properties to merge into the values supplied by `source`.

## Returns

`IEnumerable<KeyValuePair<string, ReferenceExpression>>` -- A sequence that contains the combined set of connection properties with duplicate keys resolved in favor of `additional`.

## ATS metadata

### Ignored by ATS

- Reason: Connection property merging is an internal helper and is not part of the ATS surface.
