# ReferenceExpression Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md)
- Kind: `Properties`
- Members: `10`

Represents an expression that might be made up of multiple resource properties. For example, a connection string might be made up of a host, port, and password from different endpoints.

## Condition

- Name: `Condition`
- Modifiers: `nullable` `get`
- Returns: [IValueProvider?](/reference/api/csharp/aspire.hosting/ivalueprovider.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs#L112)

Gets the condition value provider whose result is compared to [ReferenceExpression.MatchValue](/reference/api/csharp/aspire.hosting/referenceexpression/properties.md#matchvalue), or `null` when [ReferenceExpression.IsConditional](/reference/api/csharp/aspire.hosting/referenceexpression/properties.md#isconditional) is `false`.

```csharp
public IValueProvider? Condition { get; }
```

## Format

- Name: `Format`
- Modifiers: `get`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs#L85)

The format string for this expression.

```csharp
public string Format { get; }
```

## IsConditional

- Name: `IsConditional`
- Modifiers: `get`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs#L106)

Gets a value indicating whether this expression is a conditional expression that selects between two branches based on a condition.

```csharp
public bool IsConditional { get; }
```

## ManifestExpressions

- Name: `ManifestExpressions`
- Modifiers: `get`
- Returns: `IReadOnlyList<string>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs#L90)

The manifest expressions for the parameters for the format string.

```csharp
public IReadOnlyList<string> ManifestExpressions { get; }
```

## MatchValue

- Name: `MatchValue`
- Modifiers: `nullable` `get`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs#L130)

Gets the value that [ReferenceExpression.Condition](/reference/api/csharp/aspire.hosting/referenceexpression/properties.md#condition) is compared against to select the [ReferenceExpression.WhenTrue](/reference/api/csharp/aspire.hosting/referenceexpression/properties.md#whentrue) branch, or `null` when [ReferenceExpression.IsConditional](/reference/api/csharp/aspire.hosting/referenceexpression/properties.md#isconditional) is `false`.

```csharp
public string? MatchValue { get; }
```

## StringFormats

- Name: `StringFormats`
- Modifiers: `get`
- Returns: `IReadOnlyList<string?>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs#L95)

The string formats of the parameters, e.g. "uri".

```csharp
public IReadOnlyList<string?> StringFormats { get; }
```

## ValueExpression

- Name: `ValueExpression`
- Modifiers: `get`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs#L180-L182)

The value expression for the format string.

```csharp
public string ValueExpression { get; }
```

## ValueProviders

- Name: `ValueProviders`
- Modifiers: `get`
- Returns: [IReadOnlyList<IValueProvider>](/reference/api/csharp/aspire.hosting/ivalueprovider.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs#L100)

The list of [IValueProvider](/reference/api/csharp/aspire.hosting/ivalueprovider.md) that will be used to resolve parameters for the format string.

```csharp
public IReadOnlyList<IValueProvider> ValueProviders { get; }
```

## WhenFalse

- Name: `WhenFalse`
- Modifiers: `nullable` `get`
- Returns: [ReferenceExpression?](/reference/api/csharp/aspire.hosting/referenceexpression.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs#L124)

Gets the expression to evaluate when [ReferenceExpression.Condition](/reference/api/csharp/aspire.hosting/referenceexpression/properties.md#condition) does not evaluate to [ReferenceExpression.MatchValue](/reference/api/csharp/aspire.hosting/referenceexpression/properties.md#matchvalue), or `null` when [ReferenceExpression.IsConditional](/reference/api/csharp/aspire.hosting/referenceexpression/properties.md#isconditional) is `false`.

```csharp
public ReferenceExpression? WhenFalse { get; }
```

## WhenTrue

- Name: `WhenTrue`
- Modifiers: `nullable` `get`
- Returns: [ReferenceExpression?](/reference/api/csharp/aspire.hosting/referenceexpression.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs#L118)

Gets the expression to evaluate when [ReferenceExpression.Condition](/reference/api/csharp/aspire.hosting/referenceexpression/properties.md#condition) evaluates to [ReferenceExpression.MatchValue](/reference/api/csharp/aspire.hosting/referenceexpression/properties.md#matchvalue), or `null` when [ReferenceExpression.IsConditional](/reference/api/csharp/aspire.hosting/referenceexpression/properties.md#isconditional) is `false`.

```csharp
public ReferenceExpression? WhenTrue { get; }
```
