Partager via


ProjectResourceBuilderExtensions.WithEndpointsInEnvironment Method

Definition

Set a filter that determines if environment variables are injected for a given endpoint. By default, all endpoints are included (if this method is not called).

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.ProjectResource> WithEndpointsInEnvironment (this Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.ProjectResource> builder, Func<Aspire.Hosting.ApplicationModel.EndpointAnnotation,bool> filter);
static member WithEndpointsInEnvironment : Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.ProjectResource> * Func<Aspire.Hosting.ApplicationModel.EndpointAnnotation, bool> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.ProjectResource>
<Extension()>
Public Function WithEndpointsInEnvironment (builder As IResourceBuilder(Of ProjectResource), filter As Func(Of EndpointAnnotation, Boolean)) As IResourceBuilder(Of ProjectResource)

Parameters

builder
IResourceBuilder<ProjectResource>

The project resource builder.

filter
Func<EndpointAnnotation,Boolean>

The filter callback that returns true if and only if the endpoint should be included.

Returns

A reference to the IResourceBuilder<T>.

Applies to