# AddDbGate

- Module: [CommunityToolkit.Aspire.Hosting.DbGate](/reference/api/go/communitytoolkit.aspire.hosting.dbgate.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: `DistributedApplicationBuilder`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Adds a DbGate container resource to the application.

## Remarks

Multiple `AddDbGate` calls will return the same resource builder instance.

## Definition

```go
func (DistributedApplicationBuilder) AddDbGate(options ...*AddDbGateOptions) DbGateContainerResource
```

## Parameters

- `options` (`...*AddDbGateOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*AddDbGateOptions` argument.

- `Name` (`*string`) -- The name of the resource. This name will be used as the connection string name when referenced in a dependency. Optional; defaults to `dbgate`.
- `Port` (`*float64`) -- The host port to bind the underlying container to.

## Returns

[`DbGateContainerResource`](/reference/api/go/communitytoolkit.aspire.hosting.dbgate/dbgatecontainerresource.md) -- A reference to the `IResourceBuilder`.

Returns a handle; failures surface later via `Err()`.

## Applies to

- `DistributedApplicationBuilder`
