Share via


EventingExtensions.OnResourceEndpointsAllocated<T> Method

Definition

Subscribes a callback to the ResourceEndpointsAllocatedEvent event within the AppHost.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> OnResourceEndpointsAllocated<T>(this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, Func<T,Aspire.Hosting.ApplicationModel.ResourceEndpointsAllocatedEvent,System.Threading.CancellationToken,System.Threading.Tasks.Task> callback) where T : Aspire.Hosting.ApplicationModel.IResourceWithEndpoints;
static member OnResourceEndpointsAllocated : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithEndpoints)> * Func<'T, Aspire.Hosting.ApplicationModel.ResourceEndpointsAllocatedEvent, System.Threading.CancellationToken, System.Threading.Tasks.Task (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithEndpoints)> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithEndpoints)> (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceWithEndpoints)
<Extension()>
Public Function OnResourceEndpointsAllocated(Of T As IResourceWithEndpoints) (builder As IResourceBuilder(Of T), callback As Func(Of T, ResourceEndpointsAllocatedEvent, CancellationToken, Task)) As IResourceBuilder(Of T)

Type Parameters

T

The resource type.

Parameters

builder
IResourceBuilder<T>

The resource builder.

callback
Func<T,ResourceEndpointsAllocatedEvent,CancellationToken,Task>

A callback to handle the event.

Returns

The IResourceBuilder<T>.

Applies to