Skip to content
Docs Try Aspire

DbGateBuilderExtensions Methods

Class Methods 4 members
Provides extension methods for DbGate resources to an Hosting.IDistributedApplicationBuilder.
AddDbGate(IDistributedApplicationBuilder, string, int?) Section titled AddDbGate(IDistributedApplicationBuilder, string, int?) extension IResourceBuilder<DbGateContainerResource>
Adds a DbGate container resource to the application.
public static class DbGateBuilderExtensions
{
public static IResourceBuilder<DbGateContainerResource> AddDbGate(
this IDistributedApplicationBuilder builder,
string name = "dbgate",
int? port = null)
{
// ...
}
}
builder IDistributedApplicationBuilder The resource builder.
name string optional 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 int? optional The host port to bind the underlying container to.
IResourceBuilder<DbGateContainerResource> A reference to the ApplicationModel.IResourceBuilder`1.
Multiple DbGateBuilderExtensions.AddDbGate calls will return the same resource builder instance.
WithDataBindMount(IResourceBuilder<DbGateContainerResource>, string, bool) Section titled WithDataBindMount(IResourceBuilder<DbGateContainerResource>, string, bool) extension IResourceBuilder<DbGateContainerResource>
Adds a bind mount for the data folder to a DbGate container resource.
public static class DbGateBuilderExtensions
{
public static IResourceBuilder<DbGateContainerResource> WithDataBindMount(
this IResourceBuilder<DbGateContainerResource> builder,
string source,
bool isReadOnly = false)
{
// ...
}
}
builder IResourceBuilder<DbGateContainerResource> The resource builder.
source string The source directory on the host to mount into the container.
isReadOnly bool optional A flag that indicates if this is a read-only mount.
IResourceBuilder<DbGateContainerResource> The ApplicationModel.IResourceBuilder`1.
WithDataVolume(IResourceBuilder<DbGateContainerResource>, string?, bool) Section titled WithDataVolume(IResourceBuilder<DbGateContainerResource>, string?, bool) extension IResourceBuilder<DbGateContainerResource>
Adds a named volume for the data folder to a DbGate container resource.
public static class DbGateBuilderExtensions
{
public static IResourceBuilder<DbGateContainerResource> WithDataVolume(
this IResourceBuilder<DbGateContainerResource> builder,
string? name = null,
bool isReadOnly = false)
{
// ...
}
}
builder IResourceBuilder<DbGateContainerResource> The resource builder.
name string? optional The name of the volume. Defaults to an auto-generated name based on the application and resource names.
isReadOnly bool optional A flag that indicates if this is a read-only volume.
IResourceBuilder<DbGateContainerResource> The ApplicationModel.IResourceBuilder`1.
WithHostPort(IResourceBuilder<DbGateContainerResource>, int?) Section titled WithHostPort(IResourceBuilder<DbGateContainerResource>, int?) extension IResourceBuilder<DbGateContainerResource>
Configures the host port that the DbGate resource is exposed on instead of using randomly assigned port.
public static class DbGateBuilderExtensions
{
public static IResourceBuilder<DbGateContainerResource> WithHostPort(
this IResourceBuilder<DbGateContainerResource> builder,
int? port)
{
// ...
}
}
builder IResourceBuilder<DbGateContainerResource> The resource builder for DbGate.
port int? The port to bind on the host. If null is used random port will be assigned.
IResourceBuilder<DbGateContainerResource> The resource builder for DbGate.