# GarnetResource Constructors

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

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

## GarnetResource(string)

- Name: `Constructor(string)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Garnet/GarnetResource.cs#L11)

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

```csharp
public class GarnetResource
{
    public GarnetResource(
        string name)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the resource.

## GarnetResource(string, ParameterResource)

- Name: `Constructor(string, ParameterResource)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Garnet/GarnetResource.cs#L18-L21)

Initializes a new instance of the [GarnetResource](/reference/api/csharp/aspire.hosting.garnet/garnetresource.md) class.

```csharp
public class GarnetResource
{
    public GarnetResource(
        string name,
        ParameterResource password)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the resource.
- `password` (`ParameterResource`)
  A parameter that contains the Garnet server password.
