ResourceExtensions.TryGetEnvironmentVariables Method

Definition

Attempts to get the environment variables from the given resource.

C#
public static bool TryGetEnvironmentVariables(this Aspire.Hosting.ApplicationModel.IResource resource, out System.Collections.Generic.IEnumerable<Aspire.Hosting.ApplicationModel.EnvironmentCallbackAnnotation>? environmentVariables);

Parameters

resource
IResource

The resource to get the environment variables from.

environmentVariables
IEnumerable<EnvironmentCallbackAnnotation>

The environment variables retrieved from the resource, if any.

Returns

True if the environment variables were successfully retrieved, false otherwise.

Applies to

Product Versions
.NET Aspire 8.0.0, 9.0.0, 9.1.0