353 references to TryGetLastAnnotation
Aspire.Hosting (55)
ApplicationModel\CertificateTrustExecutionConfigurationGatherer.cs (1)
43if (resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var caAnnotation))
ApplicationModel\CommandsConfigurationExtensions.cs (1)
17if (resource.TryGetLastAnnotation<ExcludeLifecycleCommandsAnnotation>(out _))
ApplicationModel\DotnetToolResource.cs (1)
36this.TryGetLastAnnotation<DotnetToolAnnotation>(out var toolConfig);
ApplicationModel\HttpsCertificateExecutionConfigurationGatherer.cs (1)
33if (resource.TryGetLastAnnotation<HttpsCertificateAnnotation>(out var annotation))
ApplicationModel\ParameterResource.cs (1)
133if (this.TryGetLastAnnotation<InputGeneratorAnnotation>(out var annotation))
ApplicationModel\ProjectResource.cs (1)
295if (this.TryGetLastAnnotation<IProjectMetadata>(out var metadata))
ApplicationModel\ResourceExtensions.cs (11)
549resource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var lastAnnotation) && lastAnnotation == ManifestPublishingCallbackAnnotation.Ignore; 906if (resource.TryGetLastAnnotation<ReplicaAnnotation>(out var replicaAnnotation)) 932return resource is ProjectResource || resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _); 952return resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuild) && 963if (resource.TryGetLastAnnotation<ComputeEnvironmentAnnotation>(out var computeEnvironmentAnnotation)) 977if (resource.TryGetLastAnnotation<ComputeEnvironmentAnnotation>(out var computeEnvironmentAnnotation)) 1021if (resource.TryGetLastAnnotation<ContainerLifetimeAnnotation>(out var lifetimeAnnotation)) 1037if (resource.TryGetLastAnnotation<ContainerImagePullPolicyAnnotation>(out var pullPolicyAnnotation)) 1056return !resource.TryGetLastAnnotation<ProxySupportAnnotation>(out var proxySupportAnnotation) || proxySupportAnnotation.ProxyEnabled; 1097if (resource.TryGetLastAnnotation<DcpInstancesAnnotation>(out var annotation) && !annotation.Instances.IsEmpty) 1469if (resource.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var redirectAnnotation))
ApplicationModel\ResourceNotificationService.cs (1)
814if (!resource.TryGetLastAnnotation<ResourceIconAnnotation>(out var iconAnnotation))
Backchannel\AuxiliaryBackchannelRpcTarget.cs (2)
512resourceWithEndpoints.TryGetLastAnnotation<McpServerEndpointAnnotation>(out var mcpAnnotation)) 776if (!resource.TryGetLastAnnotation<McpServerEndpointAnnotation>(out var annotation))
ContainerResourceBuilderExtensions.cs (2)
606if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation)) 754if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation))
Dashboard\DashboardEventHandlers.cs (1)
461if (dashboardResource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var certificateAuthorityAnnotation))
Dcp\DcpExecutor.cs (5)
1448if (!project.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)) 1485projectLaunchConfiguration.DisableLaunchProfile = project.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _); 1567if (resource.TryGetLastAnnotation<ResourceSnapshotAnnotation>(out var initial) && 2100if (cr.ModelResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)) 2154if (cr.ModelResource.TryGetLastAnnotation<ContainerCertificatePathsAnnotation>(out var pathsAnnotation))
Dcp\DcpHost.cs (1)
567if (resource.TryGetLastAnnotation<HttpsCertificateAnnotation>(out var certAnnotation)
Dcp\DcpNameGenerator.cs (1)
124if (resource.TryGetLastAnnotation<ContainerNameAnnotation>(out var containerNameAnnotation))
Dcp\OtlpEndpointReferenceGatherer.cs (1)
24if (!resource.IsContainer() || !resource.TryGetLastAnnotation<OtlpExporterAnnotation>(out var oea))
OtlpConfigurationExtensions.cs (1)
66if (!resource.TryGetLastAnnotation<OtlpExporterAnnotation>(out var otlpExporterAnnotation))
Publishing\ManifestPublishingContext.cs (3)
116if (resource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var manifestPublishingCallbackAnnotation)) 178if (!project.TryGetLastAnnotation<IProjectMetadata>(out var metadata)) 213if (deploymentTarget.DeploymentTarget.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var manifestPublishingCallbackAnnotation) &&
Publishing\ResourceContainerImageManager.cs (6)
267else if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 283else if (resource.TryGetLastAnnotation<ContainerImageAnnotation>(out var _)) 325if (!resource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)) 371if (resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation) && 526if (resource.TryGetLastAnnotation<ContainerImageAnnotation>(out _) && 527resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _))
ResourceBuilderExtensions.cs (8)
480context.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var injectionAnnotation); 714builder.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var injectionAnnotation); 857builder.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var injectionAnnotation); 891builder.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var injectionAnnotation); 2548if (builder.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var existingAnnotation)) 2604if (builder.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var existingAnnotation)) 2653if (builder.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var existingAnnotation)) 2878if (!resource.TryGetLastAnnotation<HttpsCertificateAnnotation>(out var annotation))
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (5)
19if (!projectResource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)) 26if (projectResource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _)) 160if (!projectResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var launchProfileAnnotation)) 186if (projectResource.TryGetLastAnnotation<LaunchProfileAnnotation>(out var launchProfileAnnotation)) 201if (projectResource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _))
Utils\ExtensionUtils.cs (1)
20return builder.TryGetLastAnnotation(out supportsDebuggingAnnotation)
Aspire.Hosting.Azure (12)
AzureProvisioningResource.cs (2)
133if (infrastructure.AspireResource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation)) 173if (!aspireResource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation))
AzurePublishingContext.cs (2)
175if (resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation)) 341if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
AzureResourcePreparer.cs (7)
114if (resource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultRoleAssignments)) 163else if (azureReference.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaults)) 201if (!resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var existingAppIdentityAnnotation) || 238azureResource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultRoleAssignments)) 278else if (resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation) && 311if (targetResource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation) && 414if (targetResource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation) &&
Provisioning\BicepUtilities.cs (1)
147(resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingResource) ?
Aspire.Hosting.Azure.AppContainers (7)
AzureContainerAppEnvironmentResource.cs (1)
204if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
AzureContainerAppExtensions.cs (3)
97if (appEnvResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) && 122if (appEnvResource.TryGetLastAnnotation<AzureLogAnalyticsWorkspaceReferenceAnnotation>(out var logAnalyticsReferenceAnnotation) && logAnalyticsReferenceAnnotation.Workspace is AzureProvisioningResource workspace) 159if (appEnvResource.TryGetLastAnnotation<DelegatedSubnetAnnotation>(out var subnetAnnotation))
BaseContainerAppContext.cs (1)
93if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _))
ContainerAppContext.cs (1)
44if (Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation))
ContainerAppJobContext.cs (1)
40if (Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation))
Aspire.Hosting.Azure.ApplicationInsights (1)
AzureApplicationInsightsExtensions.cs (1)
79if (azureResource.TryGetLastAnnotation<LogAnalyticsWorkspaceReferenceAnnotation>(out var annotation))
Aspire.Hosting.Azure.AppService (4)
AzureAppServiceEnvironmentExtensions.cs (1)
76if (resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) &&
AzureAppServiceEnvironmentResource.cs (2)
162if (!this.TryGetLastAnnotation<AzureAppServiceEnvironmentContextAnnotation>(out var contextAnnotation)) 352if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
AzureAppServiceWebsiteContext.cs (1)
536if (resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation))
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsExtensions.cs (1)
284if (surrogate.TryGetLastAnnotation<ContainerLifetimeAnnotation>(out var lifetimeAnnotation))
Aspire.Hosting.Azure.Functions (5)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (5)
19if (!projectResource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)) 26if (projectResource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _)) 160if (!projectResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var launchProfileAnnotation)) 186if (projectResource.TryGetLastAnnotation<LaunchProfileAnnotation>(out var launchProfileAnnotation)) 201if (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.Network (1)
AzureSubnetResource.cs (1)
122if (this.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out var serviceDelegationAnnotation))
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusExtensions.cs (1)
444if (surrogate.TryGetLastAnnotation<ContainerLifetimeAnnotation>(out var lifetimeAnnotation))
Aspire.Hosting.Azure.Sql (2)
AzureSqlServerResource.cs (2)
247this.TryGetLastAnnotation<AdminDeploymentScriptSubnetAnnotation>(out var subnetAnnotation); 611if (sql.TryGetLastAnnotation<AdminDeploymentScriptSubnetAnnotation>(out var subnetAnnotation))
Aspire.Hosting.Azure.Tests (101)
AzureAppServiceTests.cs (16)
180container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 215project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 247container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 283container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 319project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 362Assert.True(environment.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var annotation)); 521project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 557project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 593project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 628project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 702project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 733container.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 871project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 902project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 934project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 978proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target);
AzureContainerAppEnvironmentExtensionsTests.cs (2)
72Assert.True(logAnalyticsWorkspace.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation)); 77Assert.True(containerAppEnvironment.Resource.TryGetLastAnnotation<AzureLogAnalyticsWorkspaceReferenceAnnotation>(out var workspaceRef));
AzureContainerAppsTests.cs (42)
45container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 79container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 226container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 256container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 333proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 410proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 449container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 481container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 515container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 551container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 589container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 629container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 661container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 694container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 745container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 827container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 870container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 901container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 933container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 964project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1003project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1047project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1088project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1219container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1250container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1281container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1460project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1511project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1624container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1671container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1788container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1810project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1847funcjob.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1929container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1959container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2153container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2200projectResource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2390proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2421proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2461proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2502proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2549proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target);
AzureContainerRegistryTests.cs (1)
54Assert.True(environment.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation));
AzureEventHubsExtensionsTests.cs (2)
521serviceBus.Resource.TryGetLastAnnotation<ContainerLifetimeAnnotation>(out var sbLifetimeAnnotation); 522azurite.TryGetLastAnnotation<ContainerLifetimeAnnotation>(out var sqlLifetimeAnnotation);
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 (6)
66Assert.True(storage.Resource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultAssignments)); 83Assert.True(api.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var apiRoleAssignments)); 125Assert.True(api.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var apiRoleAssignments)); 131Assert.True(api2.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var api2RoleAssignments)); 180Assert.True(storage.Resource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultAssignments)); 182Assert.True(api.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var apiRoleAssignments));
AzureServiceBusExtensionsTests.cs (2)
618serviceBus.Resource.TryGetLastAnnotation<ContainerLifetimeAnnotation>(out var sbLifetimeAnnotation); 619sql.TryGetLastAnnotation<ContainerLifetimeAnnotation>(out var sqlLifetimeAnnotation);
AzureSqlExtensionsTests.cs (2)
250Assert.True(sql.Resource.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)); 281Assert.True(sql.Resource.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation));
ContainerRegistryTests.cs (2)
62project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 157if (resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var annotation) &&
ExistingAzureResourceExtensionsTests.cs (6)
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));
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)
107Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation)); 127Assert.True(dockerFile.Resource.TryGetLastAnnotation<ContainerImageAnnotation>(out var containerImageAnnotation)); 131Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation)); 149Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation1)); 153Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation2)); 170Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation1)); 174Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation2));
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
483var injectionAnnotation = context.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var annotation) ? annotation : null;
Aspire.Hosting.Docker (5)
DockerComposeInfrastructure.cs (1)
84if (environment.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
DockerComposePublishingContext.cs (1)
86if (serviceResource.TargetResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
DockerComposeServiceResource.cs (3)
139if (resourceInstance.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _) || resourceInstance is ProjectResource) 150if (TargetResource.TryGetLastAnnotation<ContainerNameAnnotation>(out var containerNameAnnotation)) 171if (TargetResource.TryGetLastAnnotation<ContainerImagePullPolicyAnnotation>(out var pullPolicyAnnotation))
Aspire.Hosting.Foundry (4)
HostedAgent\AzureHostedAgentResource.cs (1)
171if (resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var identityAnnotation))
Project\ProjectBuilderExtension.cs (1)
302if (aspireResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) && registryReferenceAnnotation.Registry is AzureProvisioningResource r)
Project\ProjectResource.cs (2)
159if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)) 215if (this.TryGetLastAnnotation<AppIdentityAnnotation>(out var identityAnnotation))
Aspire.Hosting.Foundry.Tests (1)
ProjectResourceTests.cs (1)
60Assert.True(project.Resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation));
Aspire.Hosting.Garnet (2)
GarnetBuilderExtensions.cs (1)
158if (garnet.TryGetLastAnnotation<PersistenceAnnotation>(out var persistenceAnnotation))
GarnetResource.cs (1)
54if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.JavaScript (23)
JavaScriptHostingExtensions.cs (23)
131if (c.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runCommand) && 132c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 165dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 173if (resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 181if (resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)) 206if (resource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildCommand)) 272if (resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _) && 273resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 369if (c.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runCommand)) 371if (c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) && 399if (c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 402dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 429if (c.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)) 440if (c.Resource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildCommand)) 456if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerFileAnnotation)) 476if (resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 527if (c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) && 764if (!resource.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out _)) 960var hasRunScript = resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _); 961var hasPackageManager = resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var pmAnnotation); 989if (resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var pmAnnotation)) 1146if (!resource.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) || 1147!resource.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand))
Aspire.Hosting.JavaScript.Tests (49)
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));
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 (35)
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));
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 (2)
KubernetesPublishingContext.cs (1)
74if (serviceResource.TargetResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
KubernetesResource.cs (1)
138if (!resourceInstance.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _) && resourceInstance is not ProjectResource)
Aspire.Hosting.Maui (6)
Lifecycle\UnsupportedPlatformEventSubscriber.cs (1)
31resource.TryGetLastAnnotation<UnsupportedPlatformAnnotation>(out var annotation))
MauiOtlpExtensions.cs (1)
65if (!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.PostgreSQL (2)
PostgresServerResource.cs (2)
67if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 83if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Python (19)
PythonAppResourceBuilderExtensions.cs (19)
436if (!context.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 443context.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnvironmentAnnotation); 460var isUsingUv = context.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var pkgMgr) && 530context.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 631context.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 870if (!builder.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 925if (!builder.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 951if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var annotation) || annotation.VirtualEnvironment is null) 984if (!ctx.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var annotation)) 1052if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1079if (!context.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var existingAnnotation)) 1148if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1339if (!builder.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager) || 1340!builder.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installCommand)) 1374if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1454var shouldSkipInstallerWait = installerBuilder?.Resource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _) ?? false; 1493var isUsingUv = builder.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var pkgMgr) && 1503if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1533if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var existing))
Aspire.Hosting.Python.Tests (24)
AddPythonAppTests.cs (24)
744Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 748Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 768Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 850Assert.True(installerResource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var certAnnotation)); 875Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 879Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 906Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 910Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 1874Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 1878Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 1908Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 1912Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 1945Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 1949Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 1969Assert.False(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out _)); 2075Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2110Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2114Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var envAnnotation)); 2150Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var envAnnotation)); 2180Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var envAnnotation)); 2281Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2313Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2350Assert.True(installerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 2383Assert.True(installerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _));
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
172var injectionAnnotation = builder.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var annotation) ? annotation : null;
Aspire.Hosting.Redis (3)
RedisBuilderExtensions.cs (1)
120if (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.SqlServer (2)
SqlServerServerResource.cs (2)
105if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 121if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Tests (4)
Orchestrator\ApplicationOrchestratorTests.cs (1)
555if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
PublishAsConnectionStringTests.cs (1)
19Assert.True(redis.Resource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out _));
Publishing\ResourceContainerImageManagerTests.cs (1)
1102if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation))
WithIconNameTests.cs (1)
100Assert.True(container.Resource.TryGetLastAnnotation<ResourceIconAnnotation>(out var lastAnnotation));
Aspire.Hosting.Valkey (2)
ValkeyBuilderExtensions.cs (1)
170if (valkey.TryGetLastAnnotation<PersistenceAnnotation>(out var persistenceAnnotation))
ValkeyResource.cs (1)
54if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
AzureAppService.AppHost (1)
Program.cs (1)
39if (context.Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var identity))
AzureContainerApps.AppHost (1)
Program.cs (1)
50if (context.Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var identity))