# VolumeNameGenerator Methods

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

Utility class for generating volume names.

## Generate(IResourceBuilder<T>, string)

- Name: `Generate(IResourceBuilder<T>, string)`
- Modifiers: `static`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/VolumeNameGenerator.cs#L23-L34)

Generates a volume name with the form `{applicationName}-{sha256 of apphost path}-{resourceName}-{suffix}`, e.g. `myapplication-a345f2451-postgres-data`.

```csharp
public static class VolumeNameGenerator
{
    public static string Generate<T>(
        IResourceBuilder<T> builder,
        string suffix)
    {
        // ...
    }
}
```

## Parameters

- `builder` ([IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md))
  The resource builder.
- `suffix` (`string`)
  The suffix to append to the volume name.

## Returns

`string` -- The volume name.

## Exceptions

- `ArgumentException`
