635 references to TryGetLastAnnotation
Aspire.Hosting (71)
ApplicationModel\ArgumentsExecutionConfigurationGatherer.cs (1)
64if (!resource.TryGetLastAnnotation<LaunchToolArgsCallbackAnnotation>(out var launchToolAnnotation))
ApplicationModel\CertificateTrustExecutionConfigurationGatherer.cs (1)
46if (resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var caAnnotation))
ApplicationModel\CommandsConfigurationExtensions.cs (1)
20if (resource.TryGetLastAnnotation<ExcludeLifecycleCommandsAnnotation>(out _))
ApplicationModel\DebugSupportExtensions.cs (3)
51if (!resource.TryGetLastAnnotation(out supportsDebuggingAnnotation) 92return resource.TryGetLastAnnotation<LaunchToolArgsCallbackAnnotation>(out var launchToolAnnotation) 179if (!resource.TryGetLastAnnotation<SupportsDebuggingAnnotation>(out var supportsDebuggingAnnotation))
ApplicationModel\DotnetToolResource.cs (1)
38this.TryGetLastAnnotation<DotnetToolAnnotation>(out var toolConfig);
ApplicationModel\ExecutableLaunchRecipe.cs (5)
322resource.TryGetLastAnnotation<LaunchToolArgsCallbackAnnotation>(out var launchToolAnnotation) && 441resource.TryGetLastAnnotation<ExecutableAnnotation>(out var executableAnnotation); 442resource.TryGetLastAnnotation<ProjectLaunchArgsOverrideAnnotation>(out var launchOverride); 489resource.TryGetLastAnnotation<LaunchToolArgsCallbackAnnotation>(out var launchToolAnnotation) && 834resource.TryGetLastAnnotation<ExecutableAnnotation>(out var executableAnnotation) &&
ApplicationModel\HttpsCertificateExecutionConfigurationGatherer.cs (1)
33if (resource.TryGetLastAnnotation<HttpsCertificateAnnotation>(out var annotation))
ApplicationModel\ParameterResource.cs (1)
145if (this.TryGetLastAnnotation<InputGeneratorAnnotation>(out var annotation))
ApplicationModel\ProjectLaunchConfigurationFactory.cs (2)
28resource.TryGetLastAnnotation<ProjectLaunchDefaultsAnnotation>(out var launchDefaults); 42DisableLaunchProfile = resource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _)
ApplicationModel\ResourceExtensions.cs (14)
309!resource.TryGetLastAnnotation<LaunchToolArgsCallbackAnnotation>(out var annotation)) 611resource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var lastAnnotation) && lastAnnotation == ManifestPublishingCallbackAnnotation.Ignore; 982if (resource.TryGetLastAnnotation<ReplicaAnnotation>(out var replicaAnnotation)) 1009return resource is ProjectResource || resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _); 1030return resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuild) && 1042if (resource.TryGetLastAnnotation<ComputeEnvironmentAnnotation>(out var computeEnvironmentAnnotation)) 1057if (resource.TryGetLastAnnotation<ComputeEnvironmentAnnotation>(out var computeEnvironmentAnnotation)) 1120if (resource.TryGetLastAnnotation<PersistenceAnnotation>(out var persistenceAnnotation)) 1134if (resource.TryGetLastAnnotation<ContainerLifetimeAnnotation>(out var containerLifetimeAnnotation)) 1181if (resource.TryGetLastAnnotation<PersistenceAnnotation>(out var persistenceAnnotation)) 1215if (resource.TryGetLastAnnotation<ContainerImagePullPolicyAnnotation>(out var pullPolicyAnnotation)) 1234return !resource.TryGetLastAnnotation<ProxySupportAnnotation>(out var proxySupportAnnotation) || proxySupportAnnotation.ProxyEnabled; 1285if (resource.TryGetLastAnnotation<DcpInstancesAnnotation>(out var annotation) && !annotation.Instances.IsEmpty) 1764if (resource.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var redirectAnnotation))
ApplicationModel\ResourceNotificationService.cs (2)
1172if (!resource.TryGetLastAnnotation<ResourceIconAnnotation>(out var iconAnnotation)) 1200if (!resource.TryGetLastAnnotation<HiddenAnnotation>(out var annotation))
Backchannel\AuxiliaryBackchannelRpcTarget.cs (2)
1057resourceWithEndpoints.TryGetLastAnnotation<McpServerEndpointAnnotation>(out var mcpAnnotation)) 1795if (!resource.TryGetLastAnnotation<McpServerEndpointAnnotation>(out var annotation))
ContainerResourceBuilderExtensions.cs (2)
697if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation)) 850if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation))
Dashboard\DashboardEventHandlers.cs (1)
430if (dashboardResource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var certificateAuthorityAnnotation))
Dcp\ContainerCreator.cs (3)
196if (container.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)) 233if (container.TryGetLastAnnotation<ContainerNameAnnotation>(out var containerNameAnnotation) && 692if (cr.ModelResource.TryGetLastAnnotation<ContainerCertificatePathsAnnotation>(out var pathsAnnotation))
Dcp\DcpExecutor.cs (1)
932if (resource.TryGetLastAnnotation<ResourceSnapshotAnnotation>(out var initial) &&
Dcp\DcpHost.cs (1)
677if (resource.TryGetLastAnnotation<HttpsCertificateAnnotation>(out var certAnnotation)
Dcp\DcpModelUtilities.cs (1)
27modelResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _) &&
Dcp\DcpNameGenerator.cs (1)
159if (resource.TryGetLastAnnotation<ContainerNameAnnotation>(out var containerNameAnnotation))
Dcp\ExecutableCreator.cs (2)
219project.TryGetLastAnnotation<ExecutableAnnotation>(out var executableAnnotation); 266if (resource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _))
Dcp\ExecutableLaunchPolicy.cs (2)
31if (resource.TryGetLastAnnotation<ProjectLaunchArgsOverrideAnnotation>(out _)) 89if (resource.TryGetLastAnnotation<ExecutableAnnotation>(out _) &&
Dcp\ResourceSnapshotBuilder.cs (1)
230&& resource.TryGetLastAnnotation<SupportsDebuggingAnnotation>(out var annotation)
DistributedApplicationBuilder.cs (1)
964if (!resource.TryGetLastAnnotation<NameValidationPolicyAnnotation>(out var policy))
ProjectResourceBuilderExtensions.cs (1)
491if (!builder.Resource.TryGetLastAnnotation<ProjectLaunchDefaultsAnnotation>(out var launchDefaults))
Publishing\ManifestPublishingContext.cs (2)
115if (resource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var manifestPublishingCallbackAnnotation)) 212if (deploymentTarget.DeploymentTarget.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var manifestPublishingCallbackAnnotation) &&
Publishing\ResourceContainerImageManager.cs (5)
273else if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 289else if (resource.TryGetLastAnnotation<ContainerImageAnnotation>(out var _)) 383if (resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation) && 555if (resource.TryGetLastAnnotation<ContainerImageAnnotation>(out _) && 556resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _))
ResourceBuilderExtensions.cs (8)
811context.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var injectionAnnotation); 1118builder.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var injectionAnnotation); 1279builder.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var injectionAnnotation); 1313builder.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var injectionAnnotation); 3998if (builder.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var existingAnnotation)) 4055if (builder.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var existingAnnotation)) 4106if (builder.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var existingAnnotation)) 4331if (!resource.TryGetLastAnnotation<HttpsCertificateAnnotation>(out var annotation))
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (5)
18if (!projectResource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)) 25if (projectResource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _)) 147if (!projectResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var launchProfileAnnotation)) 173if (projectResource.TryGetLastAnnotation<LaunchProfileAnnotation>(out var launchProfileAnnotation)) 188if (projectResource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _))
Aspire.Hosting.Azure (11)
AzureProvisioningResource.cs (2)
133if (infrastructure.AspireResource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation)) 173if (!aspireResource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation))
AzurePublishingContext.cs (2)
206if (resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation)) 418if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
AzureResourcePreparer.cs (6)
200if (resource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultRoleAssignments)) 250else if (azureReference.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaults)) 324if (!resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var existingAppIdentityAnnotation) || 357azureResource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultRoleAssignments)) 402else if (resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation) && 594if (targetResource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation) &&
Provisioning\BicepUtilities.cs (1)
214return resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingResource)
Aspire.Hosting.Azure.AppContainers (11)
AzureContainerAppEnvironmentResource.cs (1)
306if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
AzureContainerAppExtensions.cs (6)
317if (appEnvResource.TryGetLastAnnotation<AzureContainerAppEnvironmentAcrPullIdentityAnnotation>(out var identityAnnotation)) 337if (appEnvResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) && 365if (appEnvResource.TryGetLastAnnotation<AzureLogAnalyticsWorkspaceReferenceAnnotation>(out var logAnalyticsReferenceAnnotation) && logAnalyticsReferenceAnnotation.Workspace is AzureProvisioningResource workspace) 402if (appEnvResource.TryGetLastAnnotation<DelegatedSubnetAnnotation>(out var subnetAnnotation)) 810if (appEnvResource.TryGetLastAnnotation<AzureContainerAppEnvironmentAcrPullIdentityAnnotation>(out var identityAnnotation)) 825if (appEnvResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) &&
BaseContainerAppContext.cs (1)
93if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _))
ContainerAppContext.cs (1)
44if (Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation))
ContainerAppJobContext.cs (1)
38if (Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation))
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (1)
93!registry.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingRegistry))
Aspire.Hosting.Azure.ApplicationInsights (1)
AzureApplicationInsightsExtensions.cs (1)
80if (azureResource.TryGetLastAnnotation<LogAnalyticsWorkspaceReferenceAnnotation>(out var annotation))
Aspire.Hosting.Azure.AppService (7)
AzureAppServiceEnvironmentExtensions.cs (2)
114if (resource.TryGetLastAnnotation<AzureAppServiceEnvironmentAcrPullIdentityAnnotation>(out var identityAnnotation)) 136if (resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) &&
AzureAppServiceEnvironmentResource.cs (3)
258if (!this.TryGetLastAnnotation<AzureAppServiceEnvironmentContextAnnotation>(out var contextAnnotation)) 379if (this.TryGetLastAnnotation<DelegatedSubnetAnnotation>(out var subnetAnnotation)) 468if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
AzureAppServiceWebsiteContext.cs (1)
583if (resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation))
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (1)
93!registry.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingRegistry))
Aspire.Hosting.Azure.Functions (7)
DurableTask\DurableTaskHubResource.cs (1)
46if (this.TryGetLastAnnotation<DurableTaskHubNameAnnotation>(out var taskHubNameAnnotation))
DurableTask\DurableTaskSchedulerResource.cs (1)
39if (this.TryGetLastAnnotation<DurableTaskSchedulerConnectionStringAnnotation>(out var connectionStringAnnotation))
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (5)
18if (!projectResource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)) 25if (projectResource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _)) 147if (!projectResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var launchProfileAnnotation)) 173if (projectResource.TryGetLastAnnotation<LaunchProfileAnnotation>(out var launchProfileAnnotation)) 188if (projectResource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _))
Aspire.Hosting.Azure.KeyVault (2)
AzureKeyVaultResource.cs (2)
66if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 84if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Azure.Kubernetes (6)
AzureKubernetesEnvironmentExtensions.cs (3)
536var hasDefaultSubnet = aksResource.TryGetLastAnnotation<AksSubnetAnnotation>(out var subnetAnnotation); 669if (aksResource.DefaultContainerRegistry is not null || aksResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out _)) 823if (aksResource.KubernetesEnvironment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation))
AzureKubernetesEnvironmentResource.AksPipeline.cs (3)
75if (!r.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out _) && defaultUserPool is not null) 83if (r.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentity)) 763if (this.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existing) && !existing.IsTenantScope)
Aspire.Hosting.Azure.Kubernetes.Tests (21)
AzureKubernetesEnvironmentExtensionsTests.cs (12)
116Assert.True(aks.Resource.TryGetLastAnnotation<KubernetesEnvironmentAnnotation>(out var annotation)); 204Assert.True(project.Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentity)); 267Assert.True(aks.Resource.TryGetLastAnnotation<AksSubnetAnnotation>(out _)); 274Assert.True(gpuPool.Resource.TryGetLastAnnotation<AksSubnetAnnotation>(out _)); 293Assert.False(aks.Resource.TryGetLastAnnotation<AksSubnetAnnotation>(out _)); 315Assert.True(container.Resource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var affinity)); 366Assert.True(aks.Resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)); 382Assert.True(aks.Resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var aksAnnotation)); 386.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)); 556Assert.True(albSubnet.Resource.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out var delegation)); 604Assert.True(alb1.Resource.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out _)); 605Assert.True(alb2.Resource.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out _));
AzureKubernetesInfrastructureTests.cs (9)
49Assert.True(container.Resource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var affinity)); 72Assert.True(container.Resource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var affinity)); 93Assert.True(container.Resource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var affinity)); 109Assert.True(container.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target)); 146Assert.True(enva.Resource.TryGetLastAnnotation<KubernetesEnvironmentAnnotation>(out var _)); 147Assert.True(envb.Resource.TryGetLastAnnotation<KubernetesEnvironmentAnnotation>(out var _)); 153Assert.True(cache.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var cacheTarget), 157Assert.True(api.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var apiTarget), 162Assert.True(other.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var otherTarget),
Aspire.Hosting.Azure.Network (2)
AzureSubnetResource.cs (1)
124if (this.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out var serviceDelegationAnnotation))
AzureVirtualNetworkExtensions.cs (1)
319if (target.TryGetLastAnnotation<DelegatedSubnetAnnotation>(out var previousAnnotation) &&
Aspire.Hosting.Azure.Sandboxes (7)
AzureSandboxContainerDeployment.cs (2)
775if (!resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation) || 796if (!resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation) ||
AzureSandboxesExtensions.cs (1)
53if (sandboxResource.TryGetLastAnnotation<AzureSandboxGroupAcrPullIdentityAnnotation>(out var imagePullIdentityAnnotation))
AzureSandboxGroupResource.cs (3)
199var imagePullIdentity = this.TryGetLastAnnotation<AzureSandboxGroupAcrPullIdentityAnnotation>(out var imagePullIdentityAnnotation) 231if (resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentity)) 343if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (1)
93!registry.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingRegistry))
Aspire.Hosting.Azure.Sql (2)
AzureSqlServerResource.cs (2)
236this.TryGetLastAnnotation<AdminDeploymentScriptSubnetAnnotation>(out var subnetAnnotation); 693if (sql.TryGetLastAnnotation<AdminDeploymentScriptSubnetAnnotation>(out var subnetAnnotation))
Aspire.Hosting.Azure.Tests (108)
AzureAppServiceTests.cs (18)
295container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 330project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 376web.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 415container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 451container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 487project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 530Assert.True(environment.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var annotation)); 842project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 878project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 914project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 952project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 987project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1063project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1094container.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1280project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1311project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1343project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1387proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target);
AzureContainerAppEnvironmentExtensionsTests.cs (2)
75Assert.True(logAnalyticsWorkspace.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation)); 80Assert.True(containerAppEnvironment.Resource.TryGetLastAnnotation<AzureLogAnalyticsWorkspaceReferenceAnnotation>(out var workspaceRef));
AzureContainerAppsTests.cs (43)
46container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 80container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 280container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 310container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 387proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 464proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 503container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 535container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 569container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 605container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 643container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 683container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 715container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 784container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 835container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 917container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 966container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 997container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1029container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1060project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1099project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1143project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1184project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1319container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1350container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1386container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1417container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1596project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1647project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1760container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1807container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2369container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2391project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2428funcjob.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2510container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2540container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2734container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2809projectResource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2999proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3030proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3070proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3111proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3158proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target);
AzureContainerRegistryTests.cs (1)
54Assert.True(environment.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation));
AzureFunctionsTests.cs (14)
60Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 88Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 111Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 125Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 139Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 223Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 267Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 591Assert.True(functionsResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var annotation)); 608Assert.True(functionsResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var annotation)); 622Assert.False(functionsResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out _)); 639Assert.True(functionsResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var annotation)); 663Assert.True(funcApp.Resource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)); 683Assert.True(funcApp.Resource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)); 790Assert.True(functionsResource.TryGetLastAnnotation<AzureFunctionsAnnotation>(out _));
AzureKustoExtensionsTests.cs (1)
91Assert.True(kusto.Resource.TryGetLastAnnotation<EmulatorResourceAnnotation>(out _));
AzurePostgresExtensionsTests.cs (2)
442Assert.True(postgres.Resource.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)); 485Assert.True(postgres.Resource.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation));
AzureProvisioningResourceTests.cs (3)
40project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 74project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 107containerResource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target);
AzureResourcePreparerTests.cs (8)
87Assert.True(storage.Resource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultAssignments)); 106Assert.True(api.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var apiRoleAssignments)); 150Assert.True(api.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var apiRoleAssignments)); 156Assert.True(api2.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var api2RoleAssignments)); 205Assert.True(storage.Resource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultAssignments)); 207Assert.True(api.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var apiRoleAssignments)); 564Assert.True(consumer.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var consumerRoleAssignments)); 615Assert.False(bystander.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out _));
AzureSqlExtensionsTests.cs (2)
250Assert.True(sql.Resource.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)); 281Assert.True(sql.Resource.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation));
ContainerRegistryTests.cs (2)
61project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 156if (resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var annotation) &&
ExistingAzureResourceExtensionsTests.cs (10)
36Assert.True(serviceBus.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAzureResourceAnnotation)); 57Assert.True(serviceBus.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAzureResourceAnnotation)); 75Assert.True(serviceBus.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAzureResourceAnnotation)); 96Assert.True(serviceBus.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAzureResourceAnnotation)); 116Assert.True(serviceBus.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAzureResourceAnnotation)); 134Assert.True(serviceBus.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAzureResourceAnnotation)); 155Assert.True(serviceBus.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAzureResourceAnnotation)); 173Assert.True(serviceBus.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAzureResourceAnnotation)); 193Assert.True(serviceBus.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAzureResourceAnnotation)); 214Assert.True(serviceBus.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAzureResourceAnnotation));
ExistingAzureResourceTests.cs (2)
522Assert.True(serviceBus.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAzureResourceAnnotation)); 542Assert.True(serviceBus.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAzureResourceAnnotation));
Aspire.Hosting.Blazor (3)
BlazorGatewayExtensions.cs (2)
689if (resource.TryGetLastAnnotation<GatewayAppsAnnotation>(out var existing)) 701if (resource.TryGetLastAnnotation<GatewayAppsAnnotation>(out var apps))
BlazorHostedExtensions.cs (1)
166if (resource.TryGetLastAnnotation<HostedClientAnnotation>(out var existing))
Aspire.Hosting.Blazor.Tests (6)
AddBlazorWasmAppTests.cs (1)
46Assert.True(resource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var annotation));
AddDotnetProjectBlazorGatewayTests.cs (1)
23Assert.True(gateway.Resource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata));
BlazorHostedExtensionsTests.cs (1)
245Assert.True(debuggerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _));
WithBlazorAppTests.cs (3)
195Assert.True(debuggerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 196Assert.True(debuggerResource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var manifestAnnotation)); 204Assert.True(debuggerResource.TryGetLastAnnotation<ResourceSnapshotAnnotation>(out var snapshotAnnotation));
Aspire.Hosting.Containers.Tests (9)
ContainerResourceTests.cs (2)
238Assert.True(containerResource.TryGetLastAnnotation<ContainerMountAnnotation>(out var mountAnnotation)); 353Assert.True(containerResource.TryGetLastAnnotation<ContainerMountAnnotation>(out var mountAnnotation));
WithDockerfileTests.cs (7)
110Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation)); 131Assert.True(dockerFile.Resource.TryGetLastAnnotation<ContainerImageAnnotation>(out var containerImageAnnotation)); 135Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation)); 154Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation1)); 158Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation2)); 176Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation1)); 180Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation2));
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
520var injectionAnnotation = context.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var annotation) ? annotation : null;
Aspire.Hosting.Docker (5)
DockerComposeEnvironmentResource.cs (1)
369if (environment.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
DockerComposePublishingContext.cs (1)
86if (serviceResource.TargetResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
DockerComposeServiceResource.cs (3)
138if (resourceInstance.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _) || resourceInstance is ProjectResource) 149if (TargetResource.TryGetLastAnnotation<ContainerNameAnnotation>(out var containerNameAnnotation)) 170if (TargetResource.TryGetLastAnnotation<ContainerImagePullPolicyAnnotation>(out var pullPolicyAnnotation))
Aspire.Hosting.Dotnet (6)
DotnetProjectResource.cs (1)
128this.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var effectiveCallback) &&
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (5)
18if (!projectResource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)) 25if (projectResource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _)) 147if (!projectResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var launchProfileAnnotation)) 173if (projectResource.TryGetLastAnnotation<LaunchProfileAnnotation>(out var launchProfileAnnotation)) 188if (projectResource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _))
Aspire.Hosting.Dotnet.Tests (4)
DotnetProjectResourceTests.cs (4)
104Assert.True(app.Resource.TryGetLastAnnotation<IProjectMetadata>(out var metadata)); 437Assert.True(app.Resource.TryGetLastAnnotation<IProjectMetadata>(out var metadata)); 455Assert.True(app.Resource.TryGetLastAnnotation<IProjectMetadata>(out var metadata)); 578Assert.True(app.Resource.TryGetLastAnnotation<SupportsDebuggingAnnotation>(out var supportsDebugging));
Aspire.Hosting.EntityFrameworkCore (1)
EFCoreOperationExecutor.cs (1)
190if (projectResource.TryGetLastAnnotation<IProjectMetadata>(out var metadata))
Aspire.Hosting.Foundry (3)
Project\ProjectBuilderExtension.cs (1)
430if (aspireResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) && registryReferenceAnnotation.Registry is AzureProvisioningResource r)
Project\ProjectResource.cs (2)
181if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)) 278if (this.TryGetLastAnnotation<AppIdentityAnnotation>(out var identityAnnotation))
Aspire.Hosting.Foundry.Tests (2)
HostedAgentExtensionTests.cs (1)
755Assert.True(account.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaults));
ProjectResourceTests.cs (1)
64Assert.True(project.Resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation));
Aspire.Hosting.Garnet (2)
GarnetBuilderExtensions.cs (1)
159if (garnet.TryGetLastAnnotation<PersistenceAnnotation>(out var persistenceAnnotation))
GarnetResource.cs (1)
54if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Go (23)
GoHostingExtensions.cs (23)
94var programArgs = ctx.Resource.TryGetLastAnnotation<GoAppArgsAnnotation>(out var argsAnnotation) 98if (!ctx.Resource.TryGetLastAnnotation<GoDelveServerAnnotation>(out var delveAnnotation)) 115var pkg = ctx.Resource.TryGetLastAnnotation<GoPackagePathAnnotation>(out var pkgAnnotation) 177ctx.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 188var hasPrivate = ctx.Resource.TryGetLastAnnotation<GoPrivateAnnotation>(out var privateAnnotation); 363if (builder.Resource.TryGetLastAnnotation<GoModTidyAnnotation>(out _)) 387if (builder.Resource.TryGetLastAnnotation<GoModVendorBuilderAnnotation>(out var existingVendor)) 413if (builder.Resource.TryGetLastAnnotation<GoModVendorAnnotation>(out _)) 431if (builder.Resource.TryGetLastAnnotation<GoModTidyBuilderAnnotation>(out var tidyBuilder)) 459if (builder.Resource.TryGetLastAnnotation<GoModDownloadAnnotation>(out _)) 478if (builder.Resource.TryGetLastAnnotation<GoModVendorBuilderAnnotation>(out var vendorBuilder)) 482else if (builder.Resource.TryGetLastAnnotation<GoModTidyBuilderAnnotation>(out var tidyBuilder)) 507if (builder.Resource.TryGetLastAnnotation<GoVetToolAnnotation>(out _)) 743var packagePath = resource.TryGetLastAnnotation<GoPackagePathAnnotation>(out var packagePathAnnotation) 772if (ctx.Resource.TryGetLastAnnotation<GoRaceDetectorAnnotation>(out _)) 777if (ctx.Resource.TryGetLastAnnotation<GoBuildTagsAnnotation>(out var tagsAnnotation)) 782if (ctx.Resource.TryGetLastAnnotation<GoLdFlagsAnnotation>(out var ldFlagsAnnotation)) 787if (ctx.Resource.TryGetLastAnnotation<GoGcFlagsAnnotation>(out var gcFlagsAnnotation)) 792ctx.Args.Add(ctx.Resource.TryGetLastAnnotation<GoPackagePathAnnotation>(out var pkgAnnotation) 830if (includeRace && resource.TryGetLastAnnotation<GoRaceDetectorAnnotation>(out _)) 835if (resource.TryGetLastAnnotation<GoBuildTagsAnnotation>(out var tagsAnnotation)) 840if (resource.TryGetLastAnnotation<GoLdFlagsAnnotation>(out var ldFlagsAnnotation)) 845if (resource.TryGetLastAnnotation<GoGcFlagsAnnotation>(out var gcFlagsAnnotation))
Aspire.Hosting.Go.Tests (2)
AddGoAppTests.cs (1)
869Assert.False(app.Resource.TryGetLastAnnotation<DockerfileBuilderCallbackAnnotation>(out _),
GoPublicApiTests.cs (1)
258Assert.True(app.Resource.TryGetLastAnnotation<GoAppArgsAnnotation>(out var annotation));
Aspire.Hosting.Java (27)
JavaBuildToolResolver.cs (1)
69if (resource.TryGetLastAnnotation<WrapperAnnotation>(out var wrapper))
JavaDockerfileGenerator.cs (10)
122if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) 134context.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 293if (!resource.TryGetLastAnnotation<JavaJarPathAnnotation>(out var annotation) 335if (!resource.TryGetLastAnnotation<JavaJarPathAnnotation>(out var annotation)) 557if (!resource.TryGetLastAnnotation<JavaOtelAgentAnnotation>(out var annotation)) 710var selectArtifact = resource.TryGetLastAnnotation<JavaJarArtifactAnnotation>(out var artifact) 1144if (resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var buildStep)) 1149if (resource.TryGetLastAnnotation<JavaDetectedBuildToolAnnotation>(out var detected)) 1151var tool = resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var launch) 1163if (resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var buildTool))
JavaHostingExtensions.cs (16)
603if (resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var buildStep)) 609if (resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var launch)) 698if (builder.Resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var existing) && existing.Tool != tool) 705if (builder.Resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var buildStep) && buildStep.Tool != tool) 808if (builder.Resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var existing) && existing.Tool != tool) 815if (builder.Resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var launchTool) && launchTool.Tool != tool) 872if (resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var buildStep)) 962if (builder.Resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var buildTool)) 1147if (resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var buildStep)) 1233if (!builder.Resource.TryGetLastAnnotation<JavaOtelAgentAnnotation>(out var agent)) 1314var buildArgs = builder.Resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var buildStep) 1368if (!resource.TryGetLastAnnotation<JavaOtelAgentAnnotation>(out var agent)) 1388if (resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var buildTool)) 1420if (resource.TryGetLastAnnotation<JavaJarPathAnnotation>(out var jar)) 1832var explicitMainClass = resource.TryGetLastAnnotation<JavaMainClassAnnotation>(out var mainClass) 1836if (!resource.TryGetLastAnnotation<JavaJarPathAnnotation>(out var jar))
Aspire.Hosting.Java.Tests (2)
AddJavaAppTests.cs (2)
893Assert.True(app.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var certAnnotation)); 906Assert.True(javaApp.Resource.TryGetLastAnnotation<CertificateTrustConfigurationCallbackAnnotation>(out var annotation));
Aspire.Hosting.JavaScript (77)
DenoHostingExtensions.cs (14)
30if (!builder.Resource.TryGetLastAnnotation<DenoCommandLineAnnotation>(out var annotation)) 892if (resource.TryGetLastAnnotation<JavaScriptPublishModeAnnotation>(out var publishMode) && 895var packageScriptManager = resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageScriptManagerAnnotation) 907var deno = resource.TryGetLastAnnotation<DenoCommandLineAnnotation>(out var denoAnnotation) ? denoAnnotation : null; 908var runScript = resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runScriptAnnotation) ? runScriptAnnotation : null; 909var packageManager = resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManagerAnnotation) ? packageManagerAnnotation : null; 948if (resource.TryGetLastAnnotation<JavaScriptPublishModeAnnotation>(out var publishMode) && 957if (resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) && 963if (resource.TryGetLastAnnotation<DenoCommandLineAnnotation>(out var deno) && 1061if (resource.TryGetLastAnnotation<DenoCommandLineAnnotation>(out _) && 1062resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) && 1192var hasRunScript = resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _) && 1193resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) && 1196if (resource.TryGetLastAnnotation<DenoCommandLineAnnotation>(out var deno))
JavaScriptHostingExtensions.cs (63)
162if (c.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runCommand) && 163c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 198dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 199resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager); 217if (resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)) 229if (resource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildCommand)) 287if (resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _) && 288resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 380resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager); 384var launchesViaRunScript = resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _); 490if (c.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runCommand) && 491c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 522dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 533if (dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 546if (resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 552if (resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)) 563if (resource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildCommand)) 587resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out prodPackageManager) && 588resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out prodInstallCommand) && 694if (resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _) && 695resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 837if (c.Resource.TryGetLastAnnotation<DenoCommandLineAnnotation>(out var denoCommandLine)) 842c.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runScript); 843c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager); 855else if (c.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runCommand) && 856c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 896dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 902if (dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 921dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptPublishModeAnnotation>(out var publishMode); 924if (!dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) || 925!dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)) 960if (dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildCommand)) 962if (!dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 1060if (resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _) && 1061resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 1358if (builder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1422if (builder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1502if (builder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1663if (c.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runCommand)) 1665if (c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) && 1693dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptPublishModeAnnotation>(out var publishMode); 1695if (c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 1700dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 1715if (c.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)) 1726if (c.Resource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildCommand)) 1835var installAnnotation = c.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCmd) ? installCmd : null; 1889if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerFileAnnotation)) 1892resource.TryGetLastAnnotation<JavaScriptPublishModeAnnotation>(out _); 1937if (resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 1952!containerResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) || 1954!containerResource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runScript)) 2029if (c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) && 2227if (c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) && 2252if (resourceBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 2272if (!resourceBuilder.Resource.TryGetLastAnnotation<SuppressPublishValidationAnnotation>(out var suppress)) 2424if (!resource.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out _)) 2516if (!resource.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out _)) 2821var hasRunScript = resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _); 2822var hasPackageManager = resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var pmAnnotation); 2824resource.TryGetLastAnnotation<DenoCommandLineAnnotation>(out var deno) 2886if (resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var pmAnnotation)) 3046if (!resource.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) || 3047!resource.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand))
Aspire.Hosting.JavaScript.Tests (69)
AddBunAppTests.cs (7)
158Assert.False(bunResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out _)); 159Assert.False(bunResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out _)); 179Assert.True(bunResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 183Assert.True(bunResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installAnnotation)); 251Assert.True(bunApp.Resource.TryGetLastAnnotation<CertificateTrustConfigurationCallbackAnnotation>(out var annotation)); 281Assert.True(bunApp.Resource.TryGetLastAnnotation<CertificateTrustConfigurationCallbackAnnotation>(out var annotation)); 356Assert.True(bunApp.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var pmAnnotation));
AddDenoAppTests.cs (11)
1267Assert.False(denoResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out _)); 1268Assert.False(denoResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out _)); 1288Assert.True(denoResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 1292Assert.True(denoResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installAnnotation)); 1315Assert.True(denoResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 1515Assert.False(installer.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 1532Assert.True(installer.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 1550Assert.False(installer.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 2397Assert.True(denoApp.Resource.TryGetLastAnnotation<CertificateTrustConfigurationCallbackAnnotation>(out var annotation)); 2428Assert.True(denoApp.Resource.TryGetLastAnnotation<CertificateTrustConfigurationCallbackAnnotation>(out var annotation)); 2456Assert.True(denoApp.Resource.TryGetLastAnnotation<CertificateTrustConfigurationCallbackAnnotation>(out var annotation));
AddNodeAppTests.cs (4)
252Assert.False(nodeResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out _)); 255Assert.False(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out _)); 279Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 284Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installAnnotation));
AddViteAppTests.cs (1)
1073Assert.True(nodeApp.Resource.TryGetLastAnnotation<SuppressPublishValidationAnnotation>(out _));
AddViteAppWithPnpmTests.cs (3)
26Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 60Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 121Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager));
PackageInstallationTests.cs (36)
45Assert.False(nodeAppInstallResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 51Assert.True(nodeApp2InstallResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 95Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 100Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installAnnotation)); 104Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runAnnotation)); 108Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildAnnotation)); 134Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var _)); 135Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var _)); 136Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var _)); 143Assert.True(installerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 163Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 168Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installAnnotation)); 172Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runAnnotation)); 176Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildAnnotation)); 203Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var _)); 204Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var _)); 205Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var _)); 212Assert.True(installerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 231Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installAnnotation)); 255Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildAnnotation)); 299Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 303Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installAnnotation)); 310Assert.True(installerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 329Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 333Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installAnnotation)); 357Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 361Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installAnnotation)); 465Assert.True(app.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)); 477Assert.True(app.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)); 492Assert.True(app.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)); 498Assert.True(app2.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out installCommand)); 514Assert.True(app.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)); 530Assert.True(app.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)); 545Assert.True(app.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)); 560Assert.True(app.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)); 576Assert.True(installerResource.TryGetLastAnnotation<NameValidationPolicyAnnotation>(out var policy));
ResourceCreationTests.cs (7)
110Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 112Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installAnnotation)); 178Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var _)); 179Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var _)); 180Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var _)); 187Assert.True(installerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 210Assert.True(installerResource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var certAnnotation));
Aspire.Hosting.Kubernetes (13)
Deployment\HelmDeploymentEngine.cs (2)
51if (environment.TryGetLastAnnotation<HelmReleaseNameAnnotation>(out var releaseAnnotation)) 75if (environment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation))
KubernetesEnvironmentResource.cs (4)
532if (environment.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)) 1399if (environment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation)) 1853if (environment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation)) 2157if (environment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation))
KubernetesPublishingContext.cs (5)
85if (serviceResource.TargetResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) && 109if (serviceResource.TargetResource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var nodePoolAnnotation)) 437if (environment.TryGetLastAnnotation<HelmChartNameAnnotation>(out var nameAnnotation)) 447if (environment.TryGetLastAnnotation<HelmChartVersionAnnotation>(out var versionAnnotation)) 457if (environment.TryGetLastAnnotation<HelmChartDescriptionAnnotation>(out var descriptionAnnotation))
KubernetesResource.cs (2)
200if (!resourceInstance.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _) && resourceInstance is not ProjectResource) 249if (resource.TryGetLastAnnotation<ProjectLaunchDefaultsAnnotation>(out var launchDefaults) &&
Aspire.Hosting.Kubernetes.Tests (18)
KubernetesDeployTests.cs (18)
64Assert.True(env.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation)); 79Assert.True(env.TryGetLastAnnotation<HelmReleaseNameAnnotation>(out var annotation)); 94Assert.True(env.TryGetLastAnnotation<HelmChartVersionAnnotation>(out var annotation)); 114Assert.True(env.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out _)); 115Assert.True(env.TryGetLastAnnotation<HelmReleaseNameAnnotation>(out _)); 116Assert.True(env.TryGetLastAnnotation<HelmChartVersionAnnotation>(out _)); 132Assert.True(env.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var annotation)); 149Assert.True(env.TryGetLastAnnotation<HelmReleaseNameAnnotation>(out var annotation)); 166Assert.True(env.TryGetLastAnnotation<HelmChartVersionAnnotation>(out var annotation)); 181Assert.True(env.TryGetLastAnnotation<HelmChartNameAnnotation>(out var annotation)); 196Assert.True(env.TryGetLastAnnotation<HelmChartDescriptionAnnotation>(out var annotation)); 213Assert.True(env.TryGetLastAnnotation<HelmChartNameAnnotation>(out var annotation)); 230Assert.True(env.TryGetLastAnnotation<HelmChartDescriptionAnnotation>(out var annotation)); 250Assert.True(env.TryGetLastAnnotation<HelmChartNameAnnotation>(out _)); 251Assert.True(env.TryGetLastAnnotation<HelmChartVersionAnnotation>(out _)); 252Assert.True(env.TryGetLastAnnotation<HelmChartDescriptionAnnotation>(out _)); 725Assert.True(env.TryGetLastAnnotation<HelmChartNameAnnotation>(out _)); 932Assert.True(container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var dta));
Aspire.Hosting.Maui (9)
Lifecycle\MauiBuildQueueEventSubscriber.cs (3)
78if (!parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var queueAnnotation)) 136var releaseBuildLockOnResourceRunning = !resource.TryGetLastAnnotation<MauiBuildInfoAnnotation>(out var buildInfo) 172if (!resource.TryGetLastAnnotation<MauiBuildInfoAnnotation>(out var buildInfo))
Lifecycle\UnsupportedPlatformEventSubscriber.cs (1)
31resource.TryGetLastAnnotation<UnsupportedPlatformAnnotation>(out var annotation))
MauiOtlpExtensions.cs (1)
75if (!parentBuilder.Resource.TryGetLastAnnotation<OtlpDevTunnelConfigurationAnnotation>(out var tunnelConfig))
Utilities\MauiAndroidEnvironmentAnnotation.cs (2)
63if (!resource.TryGetLastAnnotation<MauiAndroidEnvironmentAnnotation>(out _)) 71if (resource.TryGetLastAnnotation<MauiAndroidEnvironmentProcessedAnnotation>(out _))
Utilities\MauiiOSEnvironmentAnnotation.cs (2)
63if (!resource.TryGetLastAnnotation<MauiiOSEnvironmentAnnotation>(out _)) 71if (resource.TryGetLastAnnotation<MauiiOSEnvironmentProcessedAnnotation>(out _))
Aspire.Hosting.Maui.Tests (20)
MauiBuildQueueTests.cs (20)
37Assert.True(parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out _)); 63Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 81Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 226Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 380Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 461Assert.True(parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 480Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 547Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 625Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 644Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 714Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 771Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 798Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 839Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 886Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 928Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 976Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 1016Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 1106Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 1347Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation);
Aspire.Hosting.MongoDB (4)
MongoDBBuilderExtensions.cs (2)
141(mongoServerResource.TryGetLastAnnotation<HttpsCertificateAnnotation>(out var certificateAnnotation) && certificateAnnotation.Certificate is not null) 447if (builder.Resource.TryGetLastAnnotation<MongoDBServerKeyFileAnnotation>(out var existingKeyFile))
MongoDBServerResource.cs (1)
113this.TryGetLastAnnotation<MongoDBServerTlsModeAnnotation>(out var annotation)
ReplicaSet\MongoDBReplicaSetBuilderExtensions.cs (1)
430var memberKeyFile = member.Resource.TryGetLastAnnotation<MongoDBServerKeyFileAnnotation>(out var existingKeyFile) ? existingKeyFile : null;
Aspire.Hosting.PostgreSQL (2)
PostgresServerResource.cs (2)
67if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 83if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Python (18)
PythonAppResourceBuilderExtensions.cs (18)
442if (!context.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 449context.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnvironmentAnnotation); 466var isUsingUv = context.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var pkgMgr) && 536context.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 637context.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 877if (!builder.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 933if (!builder.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 967if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var annotation) || annotation.VirtualEnvironment is null) 1043if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1074if (!context.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var existingAnnotation)) 1142if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1335if (!builder.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager) || 1336!builder.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installCommand)) 1370if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1451var shouldSkipInstallerWait = installerBuilder?.Resource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _) ?? false; 1490var isUsingUv = builder.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var pkgMgr) && 1500if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1530if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var existing))
Aspire.Hosting.Python.Tests (26)
AddPythonAppTests.cs (26)
746Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 750Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 770Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 852Assert.True(installerResource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var certAnnotation)); 877Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 881Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 908Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 912Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 2020Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2024Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 2054Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2058Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 2091Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2095Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 2115Assert.False(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out _)); 2221Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2256Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2260Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var envAnnotation)); 2296Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var envAnnotation)); 2326Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var envAnnotation)); 2427Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2459Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2496Assert.True(installerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 2529Assert.True(installerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 2554Assert.True(installerResource.TryGetLastAnnotation<NameValidationPolicyAnnotation>(out var policy)); 2580Assert.True(venvCreatorResource.TryGetLastAnnotation<NameValidationPolicyAnnotation>(out var policy));
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
176var injectionAnnotation = builder.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var annotation) ? annotation : null;
Aspire.Hosting.Radius (1)
Publishing\RadiusServiceDiscovery.cs (1)
120if (resource.TryGetLastAnnotation<ProjectLaunchDefaultsAnnotation>(out var launchDefaults) &&
Aspire.Hosting.Redis (3)
RedisBuilderExtensions.cs (1)
123if (redis.TryGetLastAnnotation<PersistenceAnnotation>(out var persistenceAnnotation))
RedisResource.cs (2)
108if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 124if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Rust (9)
RustDockerfileGenerator.cs (2)
67if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) 73var options = resource.TryGetLastAnnotation<RustCargoOptionsAnnotation>(out var cargoOptions)
RustHostingExtensions.cs (7)
151|| !containerBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var provisionalDockerfile)) 486if (!builder.Resource.TryGetLastAnnotation<RustCargoOptionsAnnotation>(out var options)) 502var options = resource.TryGetLastAnnotation<RustCargoOptionsAnnotation>(out var cargoOptions) 694var options = resource.TryGetLastAnnotation<RustCargoOptionsAnnotation>(out var cargoOptions) 733if (!containerBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var activeDockerfile) 791var cargoTarget = resource.TryGetLastAnnotation<RustCargoOptionsAnnotation>(out var options) 857var target = resource.TryGetLastAnnotation<RustCargoOptionsAnnotation>(out var options)
Aspire.Hosting.Rust.Tests (1)
RustPublicApiTests.cs (1)
228Assert.True(app.Resource.TryGetLastAnnotation<SupportsDebuggingAnnotation>(out _));
Aspire.Hosting.SqlServer (2)
SqlServerServerResource.cs (2)
105if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 121if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Tests (5)
Orchestrator\ApplicationOrchestratorTests.cs (1)
1223if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
ProjectResourceTests.cs (1)
1010Assert.True(rebuilder.TryGetLastAnnotation<NameValidationPolicyAnnotation>(out var policy));
PublishAsConnectionStringTests.cs (1)
22Assert.True(redis.Resource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out _));
Publishing\ResourceContainerImageManagerTests.cs (1)
1232if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation))
WithIconNameTests.cs (1)
99Assert.True(container.Resource.TryGetLastAnnotation<ResourceIconAnnotation>(out var lastAnnotation));
Aspire.Hosting.TestUtilities (1)
Utils\OtlpExporterActivationTestExtensions.cs (1)
14if (!builder.Resource.TryGetLastAnnotation<OtlpExporterAnnotation>(out var exporter))
Aspire.Hosting.Valkey (2)
ValkeyBuilderExtensions.cs (1)
172if (valkey.TryGetLastAnnotation<PersistenceAnnotation>(out var persistenceAnnotation))
ValkeyResource.cs (1)
54if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
AzureAppService.AppHost (1)
AppHost.cs (1)
41if (context.Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var identity))
AzureContainerApps.AppHost (1)
AppHost.cs (1)
50if (context.Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var identity))