Share via


ResourceBuilderExtensions.WithConnectionStringRedirection<T> Method

Definition

Registers a callback which is invoked when a connection string is requested for a resource.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithConnectionStringRedirection<T> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, Aspire.Hosting.ApplicationModel.IResourceWithConnectionString resource) where T : Aspire.Hosting.ApplicationModel.IResourceWithConnectionString;
static member WithConnectionStringRedirection : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithConnectionString)> * Aspire.Hosting.ApplicationModel.IResourceWithConnectionString -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithConnectionString)> (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithConnectionString)
<Extension()>
Public Function WithConnectionStringRedirection(Of T As IResourceWithConnectionString) (builder As IResourceBuilder(Of T), resource As IResourceWithConnectionString) As IResourceBuilder(Of T)

Type Parameters

T

The resource type.

Parameters

builder
IResourceBuilder<T>

The resource builder.

resource
IResourceWithConnectionString

Resource to which connection string generation is redirected.

Returns

A reference to the IResourceBuilder<T>.

Applies to