# GarnetResource Properties

- Package: [Aspire.Hosting.Garnet](/reference/api/csharp/aspire.hosting.garnet.md)
- Type: [GarnetResource](/reference/api/csharp/aspire.hosting.garnet/garnetresource.md)
- Kind: `Properties`
- Members: `6`

A resource that represents a Garnet resource independent of the hosting model.

## ConnectionStringExpression

- Name: `ConnectionStringExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Garnet/GarnetResource.cs#L54-L59)

Gets the connection string expression for the Garnet server.

```csharp
public ReferenceExpression ConnectionStringExpression { get; }
```

## Host

- Name: `Host`
- Modifiers: `get`
- Returns: `EndpointReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Garnet/GarnetResource.cs#L35)

Gets the host endpoint reference for this resource.

```csharp
public EndpointReferenceExpression Host { get; }
```

## PasswordParameter

- Name: `PasswordParameter`
- Modifiers: `nullable` `get`
- Returns: `ParameterResource?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Garnet/GarnetResource.cs#L45)

Gets the parameter that contains the Garnet server password.

```csharp
public ParameterResource? PasswordParameter { get; }
```

## Port

- Name: `Port`
- Modifiers: `get`
- Returns: `EndpointReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Garnet/GarnetResource.cs#L40)

Gets the port endpoint reference for this resource.

```csharp
public EndpointReferenceExpression Port { get; }
```

## PrimaryEndpoint

- Name: `PrimaryEndpoint`
- Modifiers: `get`
- Returns: `EndpointReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Garnet/GarnetResource.cs#L30)

Gets the primary endpoint for the Garnet server.

```csharp
public EndpointReference PrimaryEndpoint { get; }
```

## UriExpression

- Name: `UriExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Garnet/GarnetResource.cs#L86-L98)

Gets the connection URI expression for the Garnet server.

```csharp
public ReferenceExpression UriExpression { get; }
```

## Remarks

Format: `redis://[:{password}@]{host}:{port}`. The password segment is omitted when no password is configured.
