672 references to TryGetLastAnnotation
Aspire.Hosting (79)
ApplicationModel\ArgumentsExecutionConfigurationGatherer.cs (1)
67if (!resource.TryGetLastAnnotation<LaunchToolArgsCallbackAnnotation>(out var launchToolAnnotation))
ApplicationModel\CertificateTrustExecutionConfigurationGatherer.cs (1)
46if (resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var caAnnotation))
ApplicationModel\CommandsConfigurationExtensions.cs (1)
21if (resource.TryGetLastAnnotation<ExcludeLifecycleCommandsAnnotation>(out _))
ApplicationModel\DebugSupportExtensions.cs (3)
52if (!resource.TryGetLastAnnotation(out supportsDebuggingAnnotation) 96return resource.TryGetLastAnnotation<LaunchToolArgsCallbackAnnotation>(out var launchToolAnnotation) 183if (!resource.TryGetLastAnnotation<SupportsDebuggingAnnotation>(out var supportsDebuggingAnnotation))
ApplicationModel\DotnetToolResource.cs (1)
38this.TryGetLastAnnotation<DotnetToolAnnotation>(out var toolConfig);
ApplicationModel\ExecutableLaunchRecipe.cs (5)
328resource.TryGetLastAnnotation<LaunchToolArgsCallbackAnnotation>(out var launchToolAnnotation) && 444resource.TryGetLastAnnotation<ExecutableAnnotation>(out var executableAnnotation); 445resource.TryGetLastAnnotation<ProjectLaunchArgsOverrideAnnotation>(out var launchOverride); 493resource.TryGetLastAnnotation<LaunchToolArgsCallbackAnnotation>(out var launchToolAnnotation) && 852resource.TryGetLastAnnotation<ExecutableAnnotation>(out var executableAnnotation) &&
ApplicationModel\HttpsCertificateExecutionConfigurationGatherer.cs (1)
33if (resource.TryGetLastAnnotation<HttpsCertificateAnnotation>(out var annotation))
ApplicationModel\ParameterResource.cs (1)
571if (this.TryGetLastAnnotation<InputGeneratorAnnotation>(out var annotation))
ApplicationModel\ProjectLaunchConfigurationFactory.cs (2)
28resource.TryGetLastAnnotation<ProjectLaunchDefaultsAnnotation>(out var launchDefaults); 42DisableLaunchProfile = resource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _)
ApplicationModel\ResourceExtensions.cs (16)
310!resource.TryGetLastAnnotation<LaunchToolArgsCallbackAnnotation>(out var annotation)) 612resource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var lastAnnotation) && lastAnnotation == ManifestPublishingCallbackAnnotation.Ignore; 983if (resource.TryGetLastAnnotation<ReplicaAnnotation>(out var replicaAnnotation)) 1012resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _); 1033return resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuild) && 1039return resource.TryGetLastAnnotation<ContainerImageAnnotation>(out _) && 1040!resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _); 1051if (resource.TryGetLastAnnotation<ComputeEnvironmentAnnotation>(out var computeEnvironmentAnnotation)) 1066if (resource.TryGetLastAnnotation<ComputeEnvironmentAnnotation>(out var computeEnvironmentAnnotation)) 1129if (resource.TryGetLastAnnotation<PersistenceAnnotation>(out var persistenceAnnotation)) 1143if (resource.TryGetLastAnnotation<ContainerLifetimeAnnotation>(out var containerLifetimeAnnotation)) 1190if (resource.TryGetLastAnnotation<PersistenceAnnotation>(out var persistenceAnnotation)) 1224if (resource.TryGetLastAnnotation<ContainerImagePullPolicyAnnotation>(out var pullPolicyAnnotation)) 1243return !resource.TryGetLastAnnotation<ProxySupportAnnotation>(out var proxySupportAnnotation) || proxySupportAnnotation.ProxyEnabled; 1294if (resource.TryGetLastAnnotation<DcpInstancesAnnotation>(out var annotation) && !annotation.Instances.IsEmpty) 1773if (resource.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var redirectAnnotation))
ApplicationModel\ResourceNotificationService.cs (3)
912if (resource.TryGetLastAnnotation<ResourceTypeDisplayNameAnnotation>(out var resourceTypeDisplayNameAnnotation)) 1241if (!resource.TryGetLastAnnotation<ResourceIconAnnotation>(out var iconAnnotation)) 1269if (!resource.TryGetLastAnnotation<HiddenAnnotation>(out var annotation))
ApplicationModel\ResourceTraitSnapshotProperties.cs (1)
15var hasDisplayOrder = resource.TryGetLastAnnotation<DisplayOrderAnnotation>(out var displayOrder);
Backchannel\AuxiliaryBackchannelRpcTarget.cs (2)
1079resourceWithEndpoints.TryGetLastAnnotation<McpServerEndpointAnnotation>(out var mcpAnnotation)) 1819if (!resource.TryGetLastAnnotation<McpServerEndpointAnnotation>(out var annotation))
ContainerResourceBuilderExtensions.cs (2)
721if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation)) 874if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation))
Dashboard\DashboardEventHandlers.cs (1)
277if (dashboardResource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var certificateAuthorityAnnotation))
Dcp\ContainerCreator.cs (2)
137if (container.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)) 376if (cr.ModelResource.TryGetLastAnnotation<ContainerCertificatePathsAnnotation>(out var pathsAnnotation))
Dcp\ContainerNetworkEndpointProvisioner.cs (1)
148if (container.TryGetLastAnnotation<ContainerNameAnnotation>(out var containerNameAnnotation) &&
Dcp\DcpExecutor.cs (1)
831if (resource.TryGetLastAnnotation<ResourceSnapshotAnnotation>(out var initial) &&
Dcp\DcpHost.cs (1)
776if (resource.TryGetLastAnnotation<HttpsCertificateAnnotation>(out var certAnnotation)
Dcp\DcpModelUtilities.cs (1)
27modelResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _) &&
Dcp\DcpNameGenerator.cs (1)
173if (resource.TryGetLastAnnotation<ContainerNameAnnotation>(out var containerNameAnnotation))
Dcp\ExecutableCreator.cs (2)
302project.TryGetLastAnnotation<ExecutableAnnotation>(out var executableAnnotation); 358if (resource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _))
Dcp\ExecutableLaunchPolicy.cs (2)
32if (resource.TryGetLastAnnotation<ProjectLaunchArgsOverrideAnnotation>(out _)) 100if (resource.TryGetLastAnnotation<ExecutableAnnotation>(out _) &&
Dcp\ResourceSnapshotBuilder.cs (2)
248&& resource.TryGetLastAnnotation<SupportsDebuggingAnnotation>(out var annotation) 280appModelResource.TryGetLastAnnotation<ProjectLaunchDefaultsAnnotation>(out var launchDefaults);
DistributedApplicationBuilder.cs (1)
1134if (!resource.TryGetLastAnnotation<NameValidationPolicyAnnotation>(out var policy))
Lifecycle\DotnetBuildCommandEventingSubscriber.cs (2)
32@event.Resource.TryGetLastAnnotation<MultiThreadedBuildConfiguredAnnotation>(out _)) 40if (executable.TryGetLastAnnotation<MultiThreadedBuildConfiguredAnnotation>(out _))
ProjectResourceBuilderExtensions.cs (1)
540if (!builder.Resource.TryGetLastAnnotation<ProjectLaunchDefaultsAnnotation>(out var launchDefaults))
Publishing\ManifestPublishingContext.cs (2)
167if (resource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var manifestPublishingCallbackAnnotation)) 270if (deploymentTarget.DeploymentTarget.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var manifestPublishingCallbackAnnotation) &&
Publishing\ResourceContainerImageManager.cs (6)
401if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 622if (resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation) && 951if (resource.TryGetLastAnnotation<ContainerImageAnnotation>(out _) && 952resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _)) 1097if (resource.TryGetLastAnnotation<ContainerImageAnnotation>(out _) && 1098resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _))
ResourceBuilderExtensions.cs (8)
1062context.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var injectionAnnotation); 1375builder.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var injectionAnnotation); 1591builder.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var injectionAnnotation); 1625builder.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var injectionAnnotation); 4389if (builder.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var existingAnnotation)) 4446if (builder.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var existingAnnotation)) 4497if (builder.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var existingAnnotation)) 4759if (!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 (12)
AzureProvisioningController.cs (1)
1920!bicepResource.TryGetLastAnnotation<TenantScopedResourceAnnotation>(out var annotation))
AzureProvisioningResource.cs (3)
172if (infrastructure.AspireResource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation)) 213if (!aspireResource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation)) 258var annotationScope = resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var annotation)
AzurePublishingContext.cs (2)
205if (resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation)) 486if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
AzureResourcePreparer.cs (5)
243if (resource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultRoleAssignments)) 293else if (azureReference.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaults)) 367if (!resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var existingAppIdentityAnnotation) || 400azureResource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultRoleAssignments)) 445else if (resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation) &&
Provisioning\BicepUtilities.cs (1)
198if (!resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingResource))
Aspire.Hosting.Azure.ApiManagement (4)
AzureApiManagementExtensions.cs (4)
1611azureResource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation) && 2359if (computeEnvironment.TryGetLastAnnotation<InternalLoadBalancerAnnotation>(out var internalLoadBalancer)) 3202network.Subnet.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out var delegation); 3236if (subnet.Resource.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out var existingDelegation))
Aspire.Hosting.Azure.AppContainers (11)
AzureContainerAppEnvironmentResource.cs (1)
360if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
AzureContainerAppExtensions.cs (6)
337if (appEnvResource.TryGetLastAnnotation<AzureContainerAppEnvironmentAcrPullIdentityAnnotation>(out var identityAnnotation)) 357if (appEnvResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) && 385if (appEnvResource.TryGetLastAnnotation<AzureLogAnalyticsWorkspaceReferenceAnnotation>(out var logAnalyticsReferenceAnnotation) && logAnalyticsReferenceAnnotation.Workspace is AzureProvisioningResource workspace) 430if (appEnvResource.TryGetLastAnnotation<DelegatedSubnetAnnotation>(out var subnetAnnotation)) 871if (appEnvResource.TryGetLastAnnotation<AzureContainerAppEnvironmentAcrPullIdentityAnnotation>(out var identityAnnotation)) 886if (appEnvResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) &&
BaseContainerAppContext.cs (1)
93if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _))
ContainerAppContext.cs (1)
46if (Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation))
ContainerAppJobContext.cs (1)
38if (Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation))
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (1)
89!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 (8)
AzureAppServiceEnvironmentExtensions.cs (2)
112if (resource.TryGetLastAnnotation<AzureAppServiceEnvironmentAcrPullIdentityAnnotation>(out var identityAnnotation)) 134if (resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) &&
AzureAppServiceEnvironmentResource.cs (4)
66if (!this.TryGetLastAnnotation<AzureAppServiceEnvironmentContextAnnotation>(out var annotation)) 300if (!this.TryGetLastAnnotation<AzureAppServiceEnvironmentContextAnnotation>(out var contextAnnotation)) 421if (this.TryGetLastAnnotation<DelegatedSubnetAnnotation>(out var subnetAnnotation)) 510if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
AzureAppServiceWebsiteContext.cs (1)
635if (resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation))
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (1)
89!registry.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingRegistry))
Aspire.Hosting.Azure.EntraId (3)
EntraIdApplicationResource.cs (2)
452?? (assignment.Target.TryGetLastAnnotation<AppIdentityAnnotation>(out var annotation) 1213=> consumer.TryGetLastAnnotation<AppIdentityAnnotation>(out var annotation)
EntraIdResourceExtensions.cs (1)
1264if (keyVault.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaults) &&
Aspire.Hosting.Azure.Functions (9)
AzureFunctionsProjectResourceExtensions.cs (2)
492if (containerBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 706if (!item.TryGetLastAnnotation<AzureFunctionsHostStorageAnnotation>(out var annotation))
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)
69if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 87if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Azure.Kubernetes (6)
AzureKubernetesEnvironmentExtensions.cs (4)
124var registry = resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReference) 175if (resource.TryGetLastAnnotation<AksSubnetAnnotation>(out var subnet)) 744var hasDefaultSubnet = aksResource.TryGetLastAnnotation<AksSubnetAnnotation>(out var subnetAnnotation); 1033if (aksResource.KubernetesEnvironment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation))
AzureKubernetesEnvironmentResource.AksPipeline.cs (2)
69if (!r.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out _) && defaultUserPool is not null) 77if (r.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentity))
Aspire.Hosting.Azure.Kubernetes.Tests (22)
AzureKubernetesEnvironmentExtensionsTests.cs (12)
347Assert.True(aks.Resource.TryGetLastAnnotation<KubernetesEnvironmentAnnotation>(out var annotation)); 435Assert.True(project.Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentity)); 657Assert.True(aks.Resource.TryGetLastAnnotation<AksSubnetAnnotation>(out _)); 664Assert.True(gpuPool.Resource.TryGetLastAnnotation<AksSubnetAnnotation>(out _)); 683Assert.False(aks.Resource.TryGetLastAnnotation<AksSubnetAnnotation>(out _)); 705Assert.True(container.Resource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var affinity)); 756Assert.True(aks.Resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)); 772Assert.True(aks.Resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var aksAnnotation)); 776.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)); 1492Assert.True(albSubnet.Resource.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out var delegation)); 1540Assert.True(alb1.Resource.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out _)); 1541Assert.True(alb2.Resource.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out _));
AzureKubernetesInfrastructureTests.cs (10)
54Assert.True(container.Resource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var affinity)); 100Assert.True(container.Resource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var affinity)); 123Assert.True(container.Resource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var affinity)); 144Assert.True(container.Resource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var affinity)); 160Assert.True(container.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target)); 197Assert.True(enva.Resource.TryGetLastAnnotation<KubernetesEnvironmentAnnotation>(out var _)); 198Assert.True(envb.Resource.TryGetLastAnnotation<KubernetesEnvironmentAnnotation>(out var _)); 204Assert.True(cache.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var cacheTarget), 208Assert.True(api.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var apiTarget), 213Assert.True(other.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var otherTarget),
Aspire.Hosting.Azure.Network (5)
AzureInternalLoadBalancerExtensions.cs (3)
44if (!builder.Resource.TryGetLastAnnotation<DelegatedSubnetAnnotation>(out var delegatedSubnet)) 60if (builder.Resource.TryGetLastAnnotation<InternalLoadBalancerAnnotation>(out var existing)) 115subnet.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out var delegation);
AzureSubnetResource.cs (1)
124if (this.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out var serviceDelegationAnnotation))
AzureVirtualNetworkExtensions.cs (1)
321if (target.TryGetLastAnnotation<DelegatedSubnetAnnotation>(out var previousAnnotation) &&
Aspire.Hosting.Azure.Sandboxes (7)
AzureSandboxContainerDeployment.cs (2)
773if (!resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation) || 794if (!resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation) ||
AzureSandboxesExtensions.cs (1)
48if (sandboxResource.TryGetLastAnnotation<AzureSandboxGroupAcrPullIdentityAnnotation>(out var imagePullIdentityAnnotation))
AzureSandboxGroupResource.cs (3)
197var imagePullIdentity = this.TryGetLastAnnotation<AzureSandboxGroupAcrPullIdentityAnnotation>(out var imagePullIdentityAnnotation) 229if (resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentity)) 341if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (1)
89!registry.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingRegistry))
Aspire.Hosting.Azure.ServiceBus (2)
AzureServiceBusExtensions.cs (2)
484if (!builder.Resource.TryGetLastAnnotation<SqlServerConnectionAnnotation>(out var sqlConnection)) 720if (builder.Resource.TryGetLastAnnotation<SqlServerConnectionAnnotation>(out var previousConnection))
Aspire.Hosting.Azure.Sql (2)
AzureSqlServerResource.cs (2)
239this.TryGetLastAnnotation<AdminDeploymentScriptSubnetAnnotation>(out var subnetAnnotation); 696if (sql.TryGetLastAnnotation<AdminDeploymentScriptSubnetAnnotation>(out var subnetAnnotation))
Aspire.Hosting.Azure.Tests (109)
AzureAppServiceTests.cs (18)
366container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 401project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 447web.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 486container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 522container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 558project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 601Assert.True(environment.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var annotation)); 911project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 947project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 983project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1021project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1056project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1132project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1163container.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1349project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1380project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1412project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1456proj.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)
65container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 99container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 332container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 362container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 441proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 547proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 586container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 618container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 652container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 688container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 726container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 766container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 798container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 869container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 920container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1002container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1051container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1082container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1114container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1147project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1188project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1234project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1277project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1412container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1443container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1479container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1510container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1702project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1755project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1868container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1915container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2481container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2505project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2544funcjob.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2626container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2656container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2850container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2931projectResource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3133proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3166proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3208proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3251proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3300proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target);
AzureContainerRegistryTests.cs (1)
52Assert.True(environment.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation));
AzureEnvironmentResourceTests.cs (1)
81Assert.True(backend.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target));
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)); 217Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 261Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 907Assert.True(functionsResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var annotation)); 924Assert.True(functionsResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var annotation)); 938Assert.False(functionsResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out _)); 955Assert.True(functionsResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var annotation)); 979Assert.True(funcApp.Resource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)); 999Assert.True(funcApp.Resource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)); 1103Assert.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)
42project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 78project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 111containerResource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target);
AzureResourcePreparerTests.cs (8)
195Assert.True(storage.Resource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultAssignments)); 214Assert.True(api.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var apiRoleAssignments)); 258Assert.True(api.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var apiRoleAssignments)); 264Assert.True(api2.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var api2RoleAssignments)); 313Assert.True(storage.Resource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultAssignments)); 315Assert.True(api.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var apiRoleAssignments)); 706Assert.True(consumer.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var consumerRoleAssignments)); 757Assert.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)
844if (resource.TryGetLastAnnotation<GatewayAppsAnnotation>(out var existing)) 856if (resource.TryGetLastAnnotation<GatewayAppsAnnotation>(out var apps))
BlazorHostedExtensions.cs (1)
256if (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)
299Assert.True(debuggerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _));
WithBlazorAppTests.cs (3)
196Assert.True(debuggerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 197Assert.True(debuggerResource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var manifestAnnotation)); 205Assert.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)
108Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation)); 129Assert.True(dockerFile.Resource.TryGetLastAnnotation<ContainerImageAnnotation>(out var containerImageAnnotation)); 133Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation)); 152Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation1)); 156Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation2)); 174Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation1)); 178Assert.True(dockerFile.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var buildAnnotation2));
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
516var injectionAnnotation = context.Resource.TryGetLastAnnotation<ReferenceEnvironmentInjectionAnnotation>(out var annotation) ? annotation : null;
Aspire.Hosting.Docker (4)
DockerComposeEnvironmentResource.cs (1)
373if (environment.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
DockerComposePublishingContext.cs (1)
86if (serviceResource.TargetResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
DockerComposeServiceResource.cs (2)
153if (TargetResource.TryGetLastAnnotation<ContainerNameAnnotation>(out var containerNameAnnotation)) 174if (TargetResource.TryGetLastAnnotation<ContainerImagePullPolicyAnnotation>(out var pullPolicyAnnotation))
Aspire.Hosting.Dotnet (5)
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)
148Assert.True(app.Resource.TryGetLastAnnotation<IProjectMetadata>(out var metadata)); 458Assert.True(app.Resource.TryGetLastAnnotation<IProjectMetadata>(out var metadata)); 476Assert.True(app.Resource.TryGetLastAnnotation<IProjectMetadata>(out var metadata)); 649Assert.True(app.Resource.TryGetLastAnnotation<SupportsDebuggingAnnotation>(out var supportsDebugging));
Aspire.Hosting.EntityFrameworkCore (3)
EFCoreOperationExecutor.cs (3)
193if (projectResource.TryGetLastAnnotation<IProjectMetadata>(out var metadata)) 207if (project.TryGetLastAnnotation<DotnetProgramBuildCompletionAnnotation>(out var buildCompletion)) 436(project.TryGetLastAnnotation<IProjectMetadata>(out var metadata) && metadata.BuildEnvironment.Count > 0))
Aspire.Hosting.Foundry (3)
Project\ProjectBuilderExtension.cs (1)
439if (aspireResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) && registryReferenceAnnotation.Registry is AzureProvisioningResource r)
Project\ProjectResource.cs (2)
181if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)) 280if (this.TryGetLastAnnotation<AppIdentityAnnotation>(out var identityAnnotation))
Aspire.Hosting.Foundry.Tests (2)
HostedAgentExtensionTests.cs (1)
979Assert.True(account.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaults));
ProjectResourceTests.cs (1)
91Assert.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)
57if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Go (26)
GoHostingExtensions.cs (26)
92var programArgs = ctx.Resource.TryGetLastAnnotation<GoAppArgsAnnotation>(out var argsAnnotation) 96if (!ctx.Resource.TryGetLastAnnotation<GoDelveServerAnnotation>(out var delveAnnotation)) 113var pkg = ctx.Resource.TryGetLastAnnotation<GoPackagePathAnnotation>(out var pkgAnnotation) 199ctx.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 210var hasPrivate = ctx.Resource.TryGetLastAnnotation<GoPrivateAnnotation>(out var privateAnnotation); 395if (builder.Resource.TryGetLastAnnotation<GoModTidyAnnotation>(out _)) 420if (builder.Resource.TryGetLastAnnotation<GoModVendorBuilderAnnotation>(out var existingVendor)) 446if (builder.Resource.TryGetLastAnnotation<GoModVendorAnnotation>(out _)) 464if (builder.Resource.TryGetLastAnnotation<GoModTidyBuilderAnnotation>(out var tidyBuilder)) 492if (builder.Resource.TryGetLastAnnotation<GoModDownloadAnnotation>(out _)) 511if (builder.Resource.TryGetLastAnnotation<GoModVendorBuilderAnnotation>(out var vendorBuilder)) 515else if (builder.Resource.TryGetLastAnnotation<GoModTidyBuilderAnnotation>(out var tidyBuilder)) 540if (builder.Resource.TryGetLastAnnotation<GoVetToolAnnotation>(out _)) 792var packagePath = resource.TryGetLastAnnotation<GoPackagePathAnnotation>(out var packagePathAnnotation) 807if (resource.TryGetLastAnnotation<SupportsDebuggingAnnotation>(out var debugSupport)) 831if (ctx.Resource.TryGetLastAnnotation<GoRaceDetectorAnnotation>(out _)) 836if (ctx.Resource.TryGetLastAnnotation<GoBuildTagsAnnotation>(out var tagsAnnotation)) 841if (ctx.Resource.TryGetLastAnnotation<GoLdFlagsAnnotation>(out var ldFlagsAnnotation)) 845if (ctx.Resource.TryGetLastAnnotation<GoGcFlagsAnnotation>(out var gcFlagsAnnotation)) 850ctx.Args.Add(ctx.Resource.TryGetLastAnnotation<GoPackagePathAnnotation>(out var pkgAnnotation) 863!containerResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) || 865!resource.TryGetLastAnnotation<GoPackagePathAnnotation>(out var packagePath)) 922if (includeRace && resource.TryGetLastAnnotation<GoRaceDetectorAnnotation>(out _)) 927if (resource.TryGetLastAnnotation<GoBuildTagsAnnotation>(out var tagsAnnotation)) 932if (resource.TryGetLastAnnotation<GoLdFlagsAnnotation>(out var ldFlagsAnnotation)) 937if (resource.TryGetLastAnnotation<GoGcFlagsAnnotation>(out var gcFlagsAnnotation))
Aspire.Hosting.Go.Tests (5)
AddGoAppTests.cs (4)
1007Assert.False(app.Resource.TryGetLastAnnotation<DockerfileBuilderCallbackAnnotation>(out _), 1557Assert.True(app.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var certAnnotation)); 1569Assert.True(app.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var certAnnotation)); 1585Assert.True(goApp.Resource.TryGetLastAnnotation<CertificateTrustConfigurationCallbackAnnotation>(out var annotation));
GoPublicApiTests.cs (1)
247Assert.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)
120if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) 132context.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 291if (!resource.TryGetLastAnnotation<JavaJarPathAnnotation>(out var annotation) 333if (!resource.TryGetLastAnnotation<JavaJarPathAnnotation>(out var annotation)) 555if (!resource.TryGetLastAnnotation<JavaOtelAgentAnnotation>(out var annotation)) 708var selectArtifact = resource.TryGetLastAnnotation<JavaJarArtifactAnnotation>(out var artifact) 1142if (resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var buildStep)) 1147if (resource.TryGetLastAnnotation<JavaDetectedBuildToolAnnotation>(out var detected)) 1149var tool = resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var launch) 1161if (resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var buildTool))
JavaHostingExtensions.cs (16)
600if (resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var buildStep)) 606if (resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var launch)) 695if (builder.Resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var existing) && existing.Tool != tool) 702if (builder.Resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var buildStep) && buildStep.Tool != tool) 805if (builder.Resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var existing) && existing.Tool != tool) 812if (builder.Resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var launchTool) && launchTool.Tool != tool) 869if (resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var buildStep)) 959if (builder.Resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var buildTool)) 1144if (resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var buildStep)) 1230if (!builder.Resource.TryGetLastAnnotation<JavaOtelAgentAnnotation>(out var agent)) 1311var buildArgs = builder.Resource.TryGetLastAnnotation<JavaBuildStepAnnotation>(out var buildStep) 1365if (!resource.TryGetLastAnnotation<JavaOtelAgentAnnotation>(out var agent)) 1385if (resource.TryGetLastAnnotation<JavaBuildToolAnnotation>(out var buildTool)) 1417if (resource.TryGetLastAnnotation<JavaJarPathAnnotation>(out var jar)) 1837var explicitMainClass = resource.TryGetLastAnnotation<JavaMainClassAnnotation>(out var mainClass) 1841if (!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)
160if (c.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runCommand) && 161c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 196dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 197resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager); 215if (resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)) 227if (resource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildCommand)) 285if (resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _) && 286resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 378resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager); 382var launchesViaRunScript = resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _); 488if (c.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runCommand) && 489c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 520dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 531if (dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 544if (resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 550if (resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)) 561if (resource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildCommand)) 585resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out prodPackageManager) && 586resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out prodInstallCommand) && 692if (resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _) && 693resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 835if (c.Resource.TryGetLastAnnotation<DenoCommandLineAnnotation>(out var denoCommandLine)) 840c.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runScript); 841c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager); 853else if (c.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runCommand) && 854c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 894dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 900if (dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 919dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptPublishModeAnnotation>(out var publishMode); 922if (!dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) || 923!dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)) 958if (dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildCommand)) 960if (!dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 1058if (resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _) && 1059resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 1356if (builder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1420if (builder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1500if (builder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 1661if (c.Resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runCommand)) 1663if (c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) && 1691dockerfileContext.Resource.TryGetLastAnnotation<JavaScriptPublishModeAnnotation>(out var publishMode); 1693if (c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 1698dockerfileContext.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 1713if (c.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand)) 1724if (c.Resource.TryGetLastAnnotation<JavaScriptBuildScriptAnnotation>(out var buildCommand)) 1833var installAnnotation = c.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCmd) ? installCmd : null; 1887if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerFileAnnotation)) 1890resource.TryGetLastAnnotation<JavaScriptPublishModeAnnotation>(out _); 1926if (resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 1941!containerResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) || 1943!containerResource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runScript)) 2018if (c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) && 2219if (c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) && 2244if (resourceBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 2259if (!resourceBuilder.Resource.TryGetLastAnnotation<SuppressPublishValidationAnnotation>(out var suppress)) 2409if (!resource.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out _)) 2501if (!resource.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out _)) 2806var hasRunScript = resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _); 2807var hasPackageManager = resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var pmAnnotation); 2809resource.TryGetLastAnnotation<DenoCommandLineAnnotation>(out var deno) 2871if (resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var pmAnnotation)) 3031if (!resource.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) || 3032!resource.Resource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installCommand))
Aspire.Hosting.JavaScript.Tests (69)
AddBunAppTests.cs (7)
156Assert.False(bunResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out _)); 157Assert.False(bunResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out _)); 177Assert.True(bunResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 181Assert.True(bunResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installAnnotation)); 249Assert.True(bunApp.Resource.TryGetLastAnnotation<CertificateTrustConfigurationCallbackAnnotation>(out var annotation)); 279Assert.True(bunApp.Resource.TryGetLastAnnotation<CertificateTrustConfigurationCallbackAnnotation>(out var annotation)); 354Assert.True(bunApp.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var pmAnnotation));
AddDenoAppTests.cs (11)
1266Assert.False(denoResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out _)); 1267Assert.False(denoResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out _)); 1287Assert.True(denoResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 1291Assert.True(denoResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installAnnotation)); 1314Assert.True(denoResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 1514Assert.False(installer.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 1531Assert.True(installer.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 1549Assert.False(installer.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 2396Assert.True(denoApp.Resource.TryGetLastAnnotation<CertificateTrustConfigurationCallbackAnnotation>(out var annotation)); 2427Assert.True(denoApp.Resource.TryGetLastAnnotation<CertificateTrustConfigurationCallbackAnnotation>(out var annotation)); 2455Assert.True(denoApp.Resource.TryGetLastAnnotation<CertificateTrustConfigurationCallbackAnnotation>(out var annotation));
AddNodeAppTests.cs (4)
250Assert.False(nodeResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out _)); 253Assert.False(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out _)); 277Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)); 282Assert.True(nodeResource.TryGetLastAnnotation<JavaScriptInstallCommandAnnotation>(out var installAnnotation));
AddViteAppTests.cs (1)
1079Assert.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)
48if (environment.TryGetLastAnnotation<HelmReleaseNameAnnotation>(out var releaseAnnotation)) 72if (environment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation))
KubernetesEnvironmentResource.cs (4)
544if (environment.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)) 1448if (environment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation)) 1902if (environment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation)) 2206if (environment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation))
KubernetesPublishingContext.cs (6)
84if (serviceResource.TargetResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) && 108if (serviceResource.TargetResource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var nodePoolAnnotation)) 346var registry = imageResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReference) 483if (environment.TryGetLastAnnotation<HelmChartNameAnnotation>(out var nameAnnotation)) 493if (environment.TryGetLastAnnotation<HelmChartVersionAnnotation>(out var versionAnnotation)) 503if (environment.TryGetLastAnnotation<HelmChartDescriptionAnnotation>(out var descriptionAnnotation))
KubernetesResource.cs (1)
247if (resource.TryGetLastAnnotation<ProjectLaunchDefaultsAnnotation>(out var launchDefaults) &&
Aspire.Hosting.Kubernetes.Tests (18)
KubernetesDeployTests.cs (18)
63Assert.True(env.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation)); 78Assert.True(env.TryGetLastAnnotation<HelmReleaseNameAnnotation>(out var annotation)); 93Assert.True(env.TryGetLastAnnotation<HelmChartVersionAnnotation>(out var annotation)); 113Assert.True(env.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out _)); 114Assert.True(env.TryGetLastAnnotation<HelmReleaseNameAnnotation>(out _)); 115Assert.True(env.TryGetLastAnnotation<HelmChartVersionAnnotation>(out _)); 131Assert.True(env.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var annotation)); 148Assert.True(env.TryGetLastAnnotation<HelmReleaseNameAnnotation>(out var annotation)); 165Assert.True(env.TryGetLastAnnotation<HelmChartVersionAnnotation>(out var annotation)); 180Assert.True(env.TryGetLastAnnotation<HelmChartNameAnnotation>(out var annotation)); 195Assert.True(env.TryGetLastAnnotation<HelmChartDescriptionAnnotation>(out var annotation)); 212Assert.True(env.TryGetLastAnnotation<HelmChartNameAnnotation>(out var annotation)); 229Assert.True(env.TryGetLastAnnotation<HelmChartDescriptionAnnotation>(out var annotation)); 249Assert.True(env.TryGetLastAnnotation<HelmChartNameAnnotation>(out _)); 250Assert.True(env.TryGetLastAnnotation<HelmChartVersionAnnotation>(out _)); 251Assert.True(env.TryGetLastAnnotation<HelmChartDescriptionAnnotation>(out _)); 724Assert.True(env.TryGetLastAnnotation<HelmChartNameAnnotation>(out _)); 931Assert.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) 176if (!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)
61if (!resource.TryGetLastAnnotation<MauiAndroidEnvironmentAnnotation>(out _)) 69if (resource.TryGetLastAnnotation<MauiAndroidEnvironmentProcessedAnnotation>(out _))
Utilities\MauiiOSEnvironmentAnnotation.cs (2)
61if (!resource.TryGetLastAnnotation<MauiiOSEnvironmentAnnotation>(out _)) 69if (resource.TryGetLastAnnotation<MauiiOSEnvironmentProcessedAnnotation>(out _))
Aspire.Hosting.Maui.Tests (21)
MauiBuildQueueTests.cs (21)
37Assert.True(parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out _)); 63Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 81Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 198Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 352Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 433Assert.True(parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 452Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 519Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 571Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 648Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 667Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 737Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 794Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 821Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 862Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 909Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 951Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 999Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 1039Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 1129Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 1363Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation);
Aspire.Hosting.MongoDB (5)
MongoDBBuilderExtensions.cs (3)
86singleMemberReplicaSetFactory: _ => mongoServerResource.TryGetLastAnnotation<MongoDBSingleMemberReplicaSetAnnotation>(out var replicaSet) ? replicaSet : null 149(mongoServerResource.TryGetLastAnnotation<HttpsCertificateAnnotation>(out var certificateAnnotation) && certificateAnnotation.Certificate is not null) 608if (builder.Resource.TryGetLastAnnotation<MongoDBServerKeyFileAnnotation>(out var existingKeyFile))
MongoDBServerResource.cs (1)
117this.TryGetLastAnnotation<MongoDBServerTlsModeAnnotation>(out var annotation)
ReplicaSet\MongoDBReplicaSetBuilderExtensions.cs (1)
409var memberKeyFile = member.Resource.TryGetLastAnnotation<MongoDBServerKeyFileAnnotation>(out var existingKeyFile) ? existingKeyFile : null;
Aspire.Hosting.PostgreSQL (2)
PostgresServerResource.cs (2)
70if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 86if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Python (20)
PythonAppResourceBuilderExtensions.cs (20)
441if (!context.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 448context.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnvironmentAnnotation); 465var isUsingUv = context.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var pkgMgr) && 552!containerResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) || 554!resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 595context.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 696context.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 936if (!builder.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 992if (!builder.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 1026if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var annotation) || annotation.VirtualEnvironment is null) 1102if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1133if (!context.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var existingAnnotation)) 1201if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1394if (!builder.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager) || 1395!builder.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installCommand)) 1429if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1510var shouldSkipInstallerWait = installerBuilder?.Resource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _) ?? false; 1549var isUsingUv = builder.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var pkgMgr) && 1559if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1589if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var existing))
Aspire.Hosting.Python.Tests (26)
AddPythonAppTests.cs (26)
780Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 784Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 804Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 886Assert.True(installerResource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var certAnnotation)); 911Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 915Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 942Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 946Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 2338Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2342Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 2372Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2376Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 2409Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2413Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 2433Assert.False(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out _)); 2539Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2574Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2578Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var envAnnotation)); 2614Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var envAnnotation)); 2644Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var envAnnotation)); 2745Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2777Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2814Assert.True(installerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 2847Assert.True(installerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 2872Assert.True(installerResource.TryGetLastAnnotation<NameValidationPolicyAnnotation>(out var policy)); 2898Assert.True(venvCreatorResource.TryGetLastAnnotation<NameValidationPolicyAnnotation>(out var policy));
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
197var 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)
124if (redis.TryGetLastAnnotation<PersistenceAnnotation>(out var persistenceAnnotation))
RedisResource.cs (2)
111if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 127if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Rust (9)
RustDockerfileGenerator.cs (2)
65if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) 71var options = resource.TryGetLastAnnotation<RustCargoOptionsAnnotation>(out var cargoOptions)
RustHostingExtensions.cs (7)
148|| !containerBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var provisionalDockerfile)) 483if (!builder.Resource.TryGetLastAnnotation<RustCargoOptionsAnnotation>(out var options)) 499var options = resource.TryGetLastAnnotation<RustCargoOptionsAnnotation>(out var cargoOptions) 691var options = resource.TryGetLastAnnotation<RustCargoOptionsAnnotation>(out var cargoOptions) 730if (!containerBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var activeDockerfile) 788var cargoTarget = resource.TryGetLastAnnotation<RustCargoOptionsAnnotation>(out var options) 854var 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)
108if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 124if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Tests (5)
Orchestrator\ApplicationOrchestratorTests.cs (1)
1774if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
ProjectResourceTests.cs (1)
1151Assert.True(rebuilder.TryGetLastAnnotation<NameValidationPolicyAnnotation>(out var policy));
PublishAsConnectionStringTests.cs (1)
22Assert.True(redis.Resource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out _));
Publishing\ResourceContainerImageManagerTests.cs (1)
1976if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation))
WithIconNameTests.cs (1)
101Assert.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)
174if (valkey.TryGetLastAnnotation<PersistenceAnnotation>(out var persistenceAnnotation))
ValkeyResource.cs (1)
57if (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))
Terminals.AppHost (1)
TerminalInteractionCommands.cs (1)
557return container.TryGetLastAnnotation<ContainerNameAnnotation>(out var annotation)