Compartilhar via


IDistributedApplicationResourceBuilderExtensions.WithReference<TDestination> Method

Definition

Associates a Dapr component with the Dapr sidecar started for the resource.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<TDestination> WithReference<TDestination> (this Aspire.Hosting.ApplicationModel.IResourceBuilder<TDestination> builder, Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Dapr.IDaprComponentResource> component) where TDestination : Aspire.Hosting.ApplicationModel.IResource;
static member WithReference : Aspire.Hosting.ApplicationModel.IResourceBuilder<'Destination (requires 'Destination :> Aspire.Hosting.ApplicationModel.IResource)> * Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Dapr.IDaprComponentResource> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'Destination (requires 'Destination :> Aspire.Hosting.ApplicationModel.IResource)> (requires 'Destination :> Aspire.Hosting.ApplicationModel.IResource)
<Extension()>
Public Function WithReference(Of TDestination As IResource) (builder As IResourceBuilder(Of TDestination), component As IResourceBuilder(Of IDaprComponentResource)) As IResourceBuilder(Of TDestination)

Type Parameters

TDestination

The type of the resource.

Parameters

builder
IResourceBuilder<TDestination>

The resource builder instance.

component
IResourceBuilder<IDaprComponentResource>

The Dapr component to use with the sidecar.

Returns

IResourceBuilder<TDestination>

Applies to