Skip to content
DocsTry Aspire
DocsTry

DbxBuilderExtensions Methods

ClassMethods2 members
Provides extension methods for dbx resources to an Hosting.IDistributedApplicationBuilder.
AddDbx(IDistributedApplicationBuilder, string, int?)Section titled AddDbx(IDistributedApplicationBuilder, string, int?)extensionIResourceBuilder<DbxContainerResource>
Adds a dbx container resource to the application.
public static class DbxBuilderExtensions
{
public static IResourceBuilder<DbxContainerResource> AddDbx(
this IDistributedApplicationBuilder builder,
string name = "dbx",
int? port = null)
{
// ...
}
}
builderIDistributedApplicationBuilderThe resource builder.
namestringoptionalThe name of the resource. This name will be used as the connection string name when referenced in a dependency. Optional; defaults to dbx.
portint?optionalThe host port to bind the underlying container to.
IResourceBuilder<DbxContainerResource>A reference to the ApplicationModel.IResourceBuilder`1.
Multiple DbxBuilderExtensions.AddDbx calls will return the same resource builder instance.
WithHostPort(IResourceBuilder<DbxContainerResource>, int?)Section titled WithHostPort(IResourceBuilder<DbxContainerResource>, int?)extensionIResourceBuilder<DbxContainerResource>
Configures the host port that the dbx resource is exposed on instead of using randomly assigned port.
public static class DbxBuilderExtensions
{
public static IResourceBuilder<DbxContainerResource> WithHostPort(
this IResourceBuilder<DbxContainerResource> builder,
int? port)
{
// ...
}
}
builderIResourceBuilder<DbxContainerResource>The resource builder for dbx.
portint?The port to bind on the host. If null is used random port will be assigned.
IResourceBuilder<DbxContainerResource>The resource builder for dbx.