# GarnetResource

- Kind: `class`
- Package: [Aspire.Hosting.Garnet](/reference/api/csharp/aspire.hosting.garnet.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Garnet/GarnetResource.cs)
- Inherits: `ContainerResource`
- Implements: `IExpressionValue`, `IManifestExpressionProvider`, `IResource`, `IResourceWithConnectionString`, `IValueProvider`, `IValueWithReferences`

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

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public class GarnetResource
    : Aspire.Hosting.ApplicationModel.ContainerResource,
      Aspire.Hosting.ApplicationModel.IExpressionValue,
      Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
      Aspire.Hosting.ApplicationModel.IValueProvider,
      Aspire.Hosting.ApplicationModel.IValueWithReferences
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting.Garnet/GarnetResource`

## Constructors

- [GarnetResource(string)](/reference/api/csharp/aspire.hosting.garnet/garnetresource/constructors.md#constructor-string) -- A resource that represents a Garnet resource independent of the hosting model.
- [GarnetResource(string, ParameterResource)](/reference/api/csharp/aspire.hosting.garnet/garnetresource/constructors.md#constructor-string-parameterresource) -- Initializes a new instance of the [GarnetResource](/reference/api/csharp/aspire.hosting.garnet/garnetresource.md) class.

## Properties

- [ConnectionStringExpression](/reference/api/csharp/aspire.hosting.garnet/garnetresource/properties.md#connectionstringexpression) : `ReferenceExpression` `get` -- Gets the connection string expression for the Garnet server.
- [Host](/reference/api/csharp/aspire.hosting.garnet/garnetresource/properties.md#host) : `EndpointReferenceExpression` `get` -- Gets the host endpoint reference for this resource.
- [PasswordParameter](/reference/api/csharp/aspire.hosting.garnet/garnetresource/properties.md#passwordparameter) : `ParameterResource?` `get` -- Gets the parameter that contains the Garnet server password.
- [Port](/reference/api/csharp/aspire.hosting.garnet/garnetresource/properties.md#port) : `EndpointReferenceExpression` `get` -- Gets the port endpoint reference for this resource.
- [PrimaryEndpoint](/reference/api/csharp/aspire.hosting.garnet/garnetresource/properties.md#primaryendpoint) : `EndpointReference` `get` -- Gets the primary endpoint for the Garnet server.
- [UriExpression](/reference/api/csharp/aspire.hosting.garnet/garnetresource/properties.md#uriexpression) : `ReferenceExpression` `get` -- Gets the connection URI expression for the Garnet server.
