1 type derived from EnvironmentCallbackAnnotation
Aspire.Hosting (1)
ApplicationModel\EnvironmentAnnotation.cs (1)
10internal sealed class EnvironmentAnnotation : EnvironmentCallbackAnnotation
22 instantiations of EnvironmentCallbackAnnotation
Aspire.Hosting (9)
Dashboard\DashboardEventHandlers.cs (1)
344dashboardResource.Annotations.Add(new EnvironmentCallbackAnnotation(ConfigureEnvironmentVariables));
OtlpConfigurationExtensions.cs (1)
97resource.Annotations.Add(new EnvironmentCallbackAnnotation(async context =>
ResourceBuilderExtensions.cs (4)
371return builder.WithAnnotation(new EnvironmentCallbackAnnotation(name, callback)); 387return builder.WithAnnotation(new EnvironmentCallbackAnnotation(callback)); 404return builder.WithAnnotation(new EnvironmentCallbackAnnotation(callback)); 1982builder.WithAnnotation(new EnvironmentCallbackAnnotation(context =>
TerminalResourceBuilderExtensions.cs (2)
212terminalHost.Annotations.Add(new EnvironmentCallbackAnnotation(ctx => 362host.Annotations.Add(new EnvironmentCallbackAnnotation(context =>
VolumeResourceBuilderExtensions.cs (1)
97builder.WithAnnotation(new EnvironmentCallbackAnnotation(
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsExtensions.cs (1)
301builder.WithAnnotation(new EnvironmentCallbackAnnotation((EnvironmentCallbackContext context) =>
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusExtensions.cs (1)
482builder.WithAnnotation(new EnvironmentCallbackAnnotation((EnvironmentCallbackContext context) =>
Aspire.Hosting.Docker (1)
DockerComposeEnvironmentResource.cs (1)
404resourceWithEnv.Annotations.Add(new EnvironmentCallbackAnnotation(context =>
Aspire.Hosting.Dotnet (3)
DotnetProjectBuildCoordinator.cs (3)
1047var annotation = new EnvironmentCallbackAnnotation(sharedBuildEnvironment.ApplyBuildEnvironmentAsync); 1059var annotation = new EnvironmentCallbackAnnotation(sharedBuildEnvironment.EnsureEvaluatedAsync); 1119var annotation = new EnvironmentCallbackAnnotation(Validate);
Aspire.Hosting.EntityFrameworkCore (1)
EFMigrationResourceBuilderExtensions.cs (1)
358migrationResource.Annotations.Add(new EnvironmentCallbackAnnotation(context =>
Aspire.Hosting.JavaScript (1)
DenoHostingExtensions.cs (1)
438var environmentCallback = new EnvironmentCallbackAnnotation(context =>
Aspire.Hosting.Kubernetes (2)
KubernetesEnvironmentResource.cs (1)
575resourceWithEnv.Annotations.Add(new EnvironmentCallbackAnnotation(context =>
KubernetesPersistentVolumeExtensions.cs (1)
540builder.WithAnnotation(new EnvironmentCallbackAnnotation(context =>
Aspire.Hosting.Maui.Tests (2)
MauiPlatformExtensionsTests.cs (2)
572resource.Annotations.Add(new EnvironmentCallbackAnnotation(context => 603resource.Annotations.Add(new EnvironmentCallbackAnnotation(context =>
Aspire.Hosting.Tests (1)
WithOtlpExporterTests.cs (1)
301resource.Annotations.Add(new EnvironmentCallbackAnnotation(context =>
82 references to EnvironmentCallbackAnnotation
Aspire.Hosting (14)
ApplicationModel\EnvironmentCallbackAnnotation.cs (4)
21/// Initializes a new instance of the <see cref="EnvironmentCallbackAnnotation"/> class with the specified name and callback function. 39/// Initializes a new instance of the <see cref="EnvironmentCallbackAnnotation"/> class with the specified callback action. 54/// Initializes a new instance of the <see cref="EnvironmentCallbackAnnotation"/> class with the specified callback. 69/// Initializes a new instance of the <see cref="EnvironmentCallbackAnnotation"/> class with the specified callback.
ApplicationModel\EnvironmentVariablesConfigurationGatherer.cs (1)
33foreach (var ann in envVarAnnotations)
ApplicationModel\ResourceExtensions.cs (5)
163public static bool TryGetEnvironmentVariables(this IResource resource, [NotNullWhen(true)] out IEnumerable<EnvironmentCallbackAnnotation>? environmentVariables) 428foreach (var callback in callbacks) 1658foreach (var ann in envAnnotations) 1674foreach (var ann in envAnnotations) 1683foreach (var ann in envAnnotations)
ApplicationModel\VolumeMountBindingAnnotation.cs (1)
21/// an environment variable. The variable itself is written by an <see cref="EnvironmentCallbackAnnotation"/>
Dcp\DcpExecutor.cs (1)
1302foreach (var callback in envCallbacks)
Publishing\ManifestPublishingContext.cs (2)
595/// Writes environment variables to the manifest base on the <see cref="IResource"/> resource's <see cref="EnvironmentCallbackAnnotation"/> annotations."/> 597/// <param name="resource">The <see cref="IResource"/> which contains <see cref="EnvironmentCallbackAnnotation"/> annotations.</param>
Aspire.Hosting.Azure.AppContainers (2)
BaseContainerAppContext.cs (2)
131if (resource.TryGetAnnotationsOfType<EnvironmentCallbackAnnotation>(out var environmentCallbacks)) 135foreach (var c in environmentCallbacks)
Aspire.Hosting.Azure.AppService (2)
AzureAppServiceWebsiteContext.cs (2)
67if (resource.TryGetAnnotationsOfType<EnvironmentCallbackAnnotation>(out var environmentCallbacks)) 72foreach (var c in environmentCallbacks)
Aspire.Hosting.Azure.Kusto.Tests (3)
AddAzureKustoTests.cs (3)
126var annotation = resourceBuilder.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().SingleOrDefault(); 433public static async Task<Dictionary<string, object>> GetEnvironmentVariables(this IDistributedApplicationTestingBuilder builder, EnvironmentCallbackAnnotation annotation)
Aspire.Hosting.Azure.Sandboxes (2)
AzureSandboxContainerDeployment.cs (2)
1140if (resource.TryGetAnnotationsOfType<EnvironmentCallbackAnnotation>(out var callbacks)) 1147foreach (var callback in callbacks)
Aspire.Hosting.Azure.Tests (10)
AzureFunctionsTests.cs (10)
231Assert.True(functionsResource.TryGetAnnotationsOfType<EnvironmentCallbackAnnotation>(out var envAnnotations)); 234foreach (var envAnnotation in envAnnotations) 287Assert.True(funcApp.Resource.TryGetAnnotationsOfType<EnvironmentCallbackAnnotation>(out var envAnnotations)); 290foreach (var envAnnotation in envAnnotations) 312Assert.True(funcApp.Resource.TryGetAnnotationsOfType<EnvironmentCallbackAnnotation>(out var envAnnotations)); 315foreach (var envAnnotation in envAnnotations) 387Assert.True(functionsResource.TryGetAnnotationsOfType<EnvironmentCallbackAnnotation>(out var envAnnotations)); 390foreach (var envAnnotation in envAnnotations) 1023Assert.True(functionsResource.TryGetAnnotationsOfType<EnvironmentCallbackAnnotation>(out var envAnnotations)); 1026foreach (var envAnnotation in envAnnotations)
Aspire.Hosting.Blazor.Tests (2)
BlazorHostedExtensionsTests.cs (2)
570foreach (var callback in resource.Annotations.OfType<EnvironmentCallbackAnnotation>())
Aspire.Hosting.Docker (2)
DockerComposeEnvironmentContext.cs (2)
136if (serviceResource.TargetResource.TryGetAnnotationsOfType<EnvironmentCallbackAnnotation>(out var environmentCallbacks)) 144foreach (var callback in environmentCallbacks)
Aspire.Hosting.Dotnet (3)
DotnetProjectBuildCoordinator.cs (3)
1047var annotation = new EnvironmentCallbackAnnotation(sharedBuildEnvironment.ApplyBuildEnvironmentAsync); 1059var annotation = new EnvironmentCallbackAnnotation(sharedBuildEnvironment.EnsureEvaluatedAsync); 1119var annotation = new EnvironmentCallbackAnnotation(Validate);
Aspire.Hosting.Dotnet.Tests (1)
DotnetProjectBuildCoordinatorTests.cs (1)
5146foreach (var environmentCallback in environmentCallbacks)
Aspire.Hosting.EntityFrameworkCore (4)
EFResourceBuilderExtensions.cs (4)
745if (migrationResource.StartupProjectResource.TryGetAnnotationsOfType<EnvironmentCallbackAnnotation>(out var envCallbacks)) 747foreach (var callback in envCallbacks) 761if (migrationResource.TryGetAnnotationsOfType<EnvironmentCallbackAnnotation>(out var migrationEnvCallbacks)) 763foreach (var callback in migrationEnvCallbacks)
Aspire.Hosting.Foundry (1)
HostedAgent\AzureHostedAgentResource.cs (1)
319foreach (var callback in callbacks)
Aspire.Hosting.JavaScript (2)
DenoCommandLineAnnotation.cs (1)
145public EnvironmentCallbackAnnotation? ServeEnvironmentCallback { get; set; }
DenoHostingExtensions.cs (1)
438var environmentCallback = new EnvironmentCallbackAnnotation(context =>
Aspire.Hosting.JavaScript.Tests (4)
AddDenoAppTests.cs (4)
1128var initialEnvironmentCallbackCount = denoApp.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Count(); 1136Assert.Equal(initialEnvironmentCallbackCount, denoApp.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Count()); 1205var initialEnvironmentCallbackCount = denoApp.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Count(); 1212Assert.Equal(initialEnvironmentCallbackCount, denoApp.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Count());
Aspire.Hosting.Kubernetes (2)
KubernetesResource.cs (2)
389if (resource.TryGetAnnotationsOfType<EnvironmentCallbackAnnotation>(out var environmentCallbacks)) 393foreach (var c in environmentCallbacks)
Aspire.Hosting.Orleans.Tests (2)
OrleansProviderTypeTests.cs (2)
123foreach (var callback in resource.Annotations.OfType<EnvironmentCallbackAnnotation>())
Aspire.Hosting.Qdrant.Tests (4)
AddQdrantTests.cs (4)
200foreach (var callback in projectA.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>()) 309foreach (var callback in consumer.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>())
Aspire.Hosting.Radius (2)
Publishing\RadiusInfrastructureBuilder.cs (2)
3662if (resource.TryGetAnnotationsOfType<EnvironmentCallbackAnnotation>(out var callbacks)) 3664foreach (var callback in callbacks)
Aspire.Hosting.Seq.Tests (1)
AddSeqTests.cs (1)
195var envAnnotations = containerResource.Annotations.OfType<EnvironmentCallbackAnnotation>();
Aspire.Hosting.Tests (19)
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (10)
586var environmentCallback = owner.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Single(); 660var environmentCallback = owner.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Single(); 984var annotation = owner.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Single(); 1039var annotation = owner.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Single(); 1249foreach (var annotation in resource.Annotations.OfType<EnvironmentCallbackAnnotation>())
ResourceDependencyTests.cs (2)
267var annotation = executable.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Single();
WithEndpointTests.cs (1)
742var envAnnotations = resource.Annotations.OfType<EnvironmentCallbackAnnotation>().ToList();
WithReferenceTests.cs (6)
946foreach (var callback in project.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>()) 1033foreach (var callback in project.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>()) 1059foreach (var callback in project.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>())