643 references to TryGetLastAnnotation
Aspire.Hosting (76)
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)
51if (!resource.TryGetLastAnnotation(out supportsDebuggingAnnotation) 93return resource.TryGetLastAnnotation<LaunchToolArgsCallbackAnnotation>(out var launchToolAnnotation) 180if (!resource.TryGetLastAnnotation<SupportsDebuggingAnnotation>(out var supportsDebuggingAnnotation))
ApplicationModel\DotnetToolResource.cs (1)
38this.TryGetLastAnnotation<DotnetToolAnnotation>(out var toolConfig);
ApplicationModel\ExecutableLaunchRecipe.cs (5)
322resource.TryGetLastAnnotation<LaunchToolArgsCallbackAnnotation>(out var launchToolAnnotation) && 441resource.TryGetLastAnnotation<ExecutableAnnotation>(out var executableAnnotation); 442resource.TryGetLastAnnotation<ProjectLaunchArgsOverrideAnnotation>(out var launchOverride); 489resource.TryGetLastAnnotation<LaunchToolArgsCallbackAnnotation>(out var launchToolAnnotation) && 834resource.TryGetLastAnnotation<ExecutableAnnotation>(out var executableAnnotation) &&
ApplicationModel\HttpsCertificateExecutionConfigurationGatherer.cs (1)
33if (resource.TryGetLastAnnotation<HttpsCertificateAnnotation>(out var annotation))
ApplicationModel\ParameterResource.cs (1)
145if (this.TryGetLastAnnotation<InputGeneratorAnnotation>(out var annotation))
ApplicationModel\ProjectLaunchConfigurationFactory.cs (2)
28resource.TryGetLastAnnotation<ProjectLaunchDefaultsAnnotation>(out var launchDefaults); 42DisableLaunchProfile = resource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _)
ApplicationModel\ResourceExtensions.cs (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 (2)
1209if (!resource.TryGetLastAnnotation<ResourceIconAnnotation>(out var iconAnnotation)) 1237if (!resource.TryGetLastAnnotation<HiddenAnnotation>(out var annotation))
Backchannel\AuxiliaryBackchannelRpcTarget.cs (2)
1079resourceWithEndpoints.TryGetLastAnnotation<McpServerEndpointAnnotation>(out var mcpAnnotation)) 1817if (!resource.TryGetLastAnnotation<McpServerEndpointAnnotation>(out var annotation))
ContainerResourceBuilderExtensions.cs (2)
694if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation)) 847if (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)
915if (resource.TryGetLastAnnotation<ResourceSnapshotAnnotation>(out var initial) &&
Dcp\DcpHost.cs (1)
767if (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)
295project.TryGetLastAnnotation<ExecutableAnnotation>(out var executableAnnotation); 351if (resource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _))
Dcp\ExecutableLaunchPolicy.cs (2)
32if (resource.TryGetLastAnnotation<ProjectLaunchArgsOverrideAnnotation>(out _)) 100if (resource.TryGetLastAnnotation<ExecutableAnnotation>(out _) &&
Dcp\ResourceSnapshotBuilder.cs (1)
230&& resource.TryGetLastAnnotation<SupportsDebuggingAnnotation>(out var annotation)
DistributedApplicationBuilder.cs (1)
982if (!resource.TryGetLastAnnotation<NameValidationPolicyAnnotation>(out var policy))
Lifecycle\DotnetBuildCommandEventingSubscriber.cs (2)
32@event.Resource.TryGetLastAnnotation<MultiThreadedBuildConfiguredAnnotation>(out _)) 40if (executable.TryGetLastAnnotation<MultiThreadedBuildConfiguredAnnotation>(out _))
ProjectResourceBuilderExtensions.cs (1)
510if (!builder.Resource.TryGetLastAnnotation<ProjectLaunchDefaultsAnnotation>(out var launchDefaults))
Publishing\ManifestPublishingContext.cs (2)
117if (resource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var manifestPublishingCallbackAnnotation)) 220if (deploymentTarget.DeploymentTarget.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var manifestPublishingCallbackAnnotation) &&
Publishing\ResourceContainerImageManager.cs (6)
401if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 594if (resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation) && 906if (resource.TryGetLastAnnotation<ContainerImageAnnotation>(out _) && 907resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _)) 1046if (resource.TryGetLastAnnotation<ContainerImageAnnotation>(out _) && 1047resource.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); 4369if (builder.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var existingAnnotation)) 4426if (builder.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var existingAnnotation)) 4477if (builder.Resource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var existingAnnotation)) 4739if (!resource.TryGetLastAnnotation<HttpsCertificateAnnotation>(out var annotation))
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (5)
18if (!projectResource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)) 25if (projectResource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _)) 147if (!projectResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var launchProfileAnnotation)) 173if (projectResource.TryGetLastAnnotation<LaunchProfileAnnotation>(out var launchProfileAnnotation)) 188if (projectResource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _))
Aspire.Hosting.Azure (11)
AzureProvisioningResource.cs (2)
133if (infrastructure.AspireResource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation)) 173if (!aspireResource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation))
AzurePublishingContext.cs (2)
202if (resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation)) 414if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
AzureResourcePreparer.cs (6)
198if (resource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultRoleAssignments)) 248else if (azureReference.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaults)) 322if (!resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var existingAppIdentityAnnotation) || 355azureResource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultRoleAssignments)) 400else if (resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation) && 592if (targetResource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation) &&
Provisioning\BicepUtilities.cs (1)
168return resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingResource)
Aspire.Hosting.Azure.AppContainers (11)
AzureContainerAppEnvironmentResource.cs (1)
323if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
AzureContainerAppExtensions.cs (6)
322if (appEnvResource.TryGetLastAnnotation<AzureContainerAppEnvironmentAcrPullIdentityAnnotation>(out var identityAnnotation)) 342if (appEnvResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) && 370if (appEnvResource.TryGetLastAnnotation<AzureLogAnalyticsWorkspaceReferenceAnnotation>(out var logAnalyticsReferenceAnnotation) && logAnalyticsReferenceAnnotation.Workspace is AzureProvisioningResource workspace) 415if (appEnvResource.TryGetLastAnnotation<DelegatedSubnetAnnotation>(out var subnetAnnotation)) 823if (appEnvResource.TryGetLastAnnotation<AzureContainerAppEnvironmentAcrPullIdentityAnnotation>(out var identityAnnotation)) 838if (appEnvResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) &&
BaseContainerAppContext.cs (1)
93if (resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out _))
ContainerAppContext.cs (1)
47if (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 (7)
AzureAppServiceEnvironmentExtensions.cs (2)
112if (resource.TryGetLastAnnotation<AzureAppServiceEnvironmentAcrPullIdentityAnnotation>(out var identityAnnotation)) 134if (resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) &&
AzureAppServiceEnvironmentResource.cs (3)
258if (!this.TryGetLastAnnotation<AzureAppServiceEnvironmentContextAnnotation>(out var contextAnnotation)) 379if (this.TryGetLastAnnotation<DelegatedSubnetAnnotation>(out var subnetAnnotation)) 468if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
AzureAppServiceWebsiteContext.cs (1)
617if (resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentityAnnotation))
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (1)
89!registry.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingRegistry))
Aspire.Hosting.Azure.Functions (7)
DurableTask\DurableTaskHubResource.cs (1)
46if (this.TryGetLastAnnotation<DurableTaskHubNameAnnotation>(out var taskHubNameAnnotation))
DurableTask\DurableTaskSchedulerResource.cs (1)
39if (this.TryGetLastAnnotation<DurableTaskSchedulerConnectionStringAnnotation>(out var connectionStringAnnotation))
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (5)
18if (!projectResource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)) 25if (projectResource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _)) 147if (!projectResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var launchProfileAnnotation)) 173if (projectResource.TryGetLastAnnotation<LaunchProfileAnnotation>(out var launchProfileAnnotation)) 188if (projectResource.TryGetLastAnnotation<ExcludeLaunchProfileAnnotation>(out _))
Aspire.Hosting.Azure.KeyVault (2)
AzureKeyVaultResource.cs (2)
66if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 84if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Azure.Kubernetes (6)
AzureKubernetesEnvironmentExtensions.cs (3)
534var hasDefaultSubnet = aksResource.TryGetLastAnnotation<AksSubnetAnnotation>(out var subnetAnnotation); 667if (aksResource.DefaultContainerRegistry is not null || aksResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out _)) 821if (aksResource.KubernetesEnvironment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation))
AzureKubernetesEnvironmentResource.AksPipeline.cs (3)
70if (!r.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out _) && defaultUserPool is not null) 78if (r.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentity)) 758if (this.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existing) && !existing.IsTenantScope)
Aspire.Hosting.Azure.Kubernetes.Tests (21)
AzureKubernetesEnvironmentExtensionsTests.cs (12)
115Assert.True(aks.Resource.TryGetLastAnnotation<KubernetesEnvironmentAnnotation>(out var annotation)); 203Assert.True(project.Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var appIdentity)); 266Assert.True(aks.Resource.TryGetLastAnnotation<AksSubnetAnnotation>(out _)); 273Assert.True(gpuPool.Resource.TryGetLastAnnotation<AksSubnetAnnotation>(out _)); 292Assert.False(aks.Resource.TryGetLastAnnotation<AksSubnetAnnotation>(out _)); 314Assert.True(container.Resource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var affinity)); 365Assert.True(aks.Resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)); 381Assert.True(aks.Resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var aksAnnotation)); 385.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)); 555Assert.True(albSubnet.Resource.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out var delegation)); 603Assert.True(alb1.Resource.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out _)); 604Assert.True(alb2.Resource.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out _));
AzureKubernetesInfrastructureTests.cs (9)
46Assert.True(container.Resource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var affinity)); 69Assert.True(container.Resource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var affinity)); 90Assert.True(container.Resource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var affinity)); 106Assert.True(container.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target)); 143Assert.True(enva.Resource.TryGetLastAnnotation<KubernetesEnvironmentAnnotation>(out var _)); 144Assert.True(envb.Resource.TryGetLastAnnotation<KubernetesEnvironmentAnnotation>(out var _)); 150Assert.True(cache.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var cacheTarget), 154Assert.True(api.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var apiTarget), 159Assert.True(other.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var otherTarget),
Aspire.Hosting.Azure.Network (2)
AzureSubnetResource.cs (1)
124if (this.TryGetLastAnnotation<AzureSubnetServiceDelegationAnnotation>(out var serviceDelegationAnnotation))
AzureVirtualNetworkExtensions.cs (1)
319if (target.TryGetLastAnnotation<DelegatedSubnetAnnotation>(out var previousAnnotation) &&
Aspire.Hosting.Azure.Sandboxes (7)
AzureSandboxContainerDeployment.cs (2)
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)
236this.TryGetLastAnnotation<AdminDeploymentScriptSubnetAnnotation>(out var subnetAnnotation); 693if (sql.TryGetLastAnnotation<AdminDeploymentScriptSubnetAnnotation>(out var subnetAnnotation))
Aspire.Hosting.Azure.Tests (108)
AzureAppServiceTests.cs (18)
342container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 377project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 423web.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 462container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 498container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 534project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 577Assert.True(environment.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var annotation)); 887project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 923project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 959project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 997project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1032project2.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1108project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1139container.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1325project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1356project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1388project.Resource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1432proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target);
AzureContainerAppEnvironmentExtensionsTests.cs (2)
74Assert.True(logAnalyticsWorkspace.Resource.TryGetLastAnnotation<ExistingAzureResourceAnnotation>(out var existingAnnotation)); 79Assert.True(containerAppEnvironment.Resource.TryGetLastAnnotation<AzureLogAnalyticsWorkspaceReferenceAnnotation>(out var workspaceRef));
AzureContainerAppsTests.cs (43)
44container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 78container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 305container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 335container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 412proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 516proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 555container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 587container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 621container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 657container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 695container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 735container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 767container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 836container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 887container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 969container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1018container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1049container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1081container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1112project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1151project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1195project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1236project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1371container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1402container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1438container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1469container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1659project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1710project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1823container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 1870container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2432container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2454project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2491funcjob.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2573container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2603container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2791container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 2866projectResource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3056proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3087proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3127proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3168proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 3215proj.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target);
AzureContainerRegistryTests.cs (1)
52Assert.True(environment.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation));
AzureFunctionsTests.cs (14)
60Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 88Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 111Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 125Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 139Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 223Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 267Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 591Assert.True(functionsResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var annotation)); 608Assert.True(functionsResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var annotation)); 622Assert.False(functionsResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out _)); 639Assert.True(functionsResource.TryGetLastAnnotation<DefaultLaunchProfileAnnotation>(out var annotation)); 663Assert.True(funcApp.Resource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)); 683Assert.True(funcApp.Resource.TryGetLastAnnotation<IProjectMetadata>(out var projectMetadata)); 790Assert.True(functionsResource.TryGetLastAnnotation<AzureFunctionsAnnotation>(out _));
AzureKustoExtensionsTests.cs (1)
91Assert.True(kusto.Resource.TryGetLastAnnotation<EmulatorResourceAnnotation>(out _));
AzurePostgresExtensionsTests.cs (2)
442Assert.True(postgres.Resource.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)); 485Assert.True(postgres.Resource.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation));
AzureProvisioningResourceTests.cs (3)
40project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 74project.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target); 107containerResource.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target);
AzureResourcePreparerTests.cs (8)
86Assert.True(storage.Resource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultAssignments)); 105Assert.True(api.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var apiRoleAssignments)); 149Assert.True(api.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var apiRoleAssignments)); 155Assert.True(api2.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var api2RoleAssignments)); 204Assert.True(storage.Resource.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaultAssignments)); 206Assert.True(api.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var apiRoleAssignments)); 563Assert.True(consumer.Resource.TryGetLastAnnotation<RoleAssignmentAnnotation>(out var consumerRoleAssignments)); 614Assert.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)
841if (resource.TryGetLastAnnotation<GatewayAppsAnnotation>(out var existing)) 853if (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)
318Assert.True(debuggerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _));
WithBlazorAppTests.cs (3)
195Assert.True(debuggerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 196Assert.True(debuggerResource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out var manifestAnnotation)); 204Assert.True(debuggerResource.TryGetLastAnnotation<ResourceSnapshotAnnotation>(out var snapshotAnnotation));
Aspire.Hosting.Containers.Tests (9)
ContainerResourceTests.cs (2)
238Assert.True(containerResource.TryGetLastAnnotation<ContainerMountAnnotation>(out var mountAnnotation)); 353Assert.True(containerResource.TryGetLastAnnotation<ContainerMountAnnotation>(out var mountAnnotation));
WithDockerfileTests.cs (7)
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)
367if (environment.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation))
DockerComposePublishingContext.cs (1)
85if (serviceResource.TargetResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) &&
DockerComposeServiceResource.cs (2)
149if (TargetResource.TryGetLastAnnotation<ContainerNameAnnotation>(out var containerNameAnnotation)) 170if (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)
156Assert.True(app.Resource.TryGetLastAnnotation<IProjectMetadata>(out var metadata)); 484Assert.True(app.Resource.TryGetLastAnnotation<IProjectMetadata>(out var metadata)); 502Assert.True(app.Resource.TryGetLastAnnotation<IProjectMetadata>(out var metadata)); 642Assert.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)
430if (aspireResource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var registryReferenceAnnotation) && registryReferenceAnnotation.Registry is AzureProvisioningResource r)
Project\ProjectResource.cs (2)
181if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)) 278if (this.TryGetLastAnnotation<AppIdentityAnnotation>(out var identityAnnotation))
Aspire.Hosting.Foundry.Tests (2)
HostedAgentExtensionTests.cs (1)
925Assert.True(account.TryGetLastAnnotation<DefaultRoleAssignmentsAnnotation>(out var defaults));
ProjectResourceTests.cs (1)
64Assert.True(project.Resource.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation));
Aspire.Hosting.Garnet (2)
GarnetBuilderExtensions.cs (1)
159if (garnet.TryGetLastAnnotation<PersistenceAnnotation>(out var persistenceAnnotation))
GarnetResource.cs (1)
54if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Go (23)
GoHostingExtensions.cs (23)
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) 175ctx.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 186var hasPrivate = ctx.Resource.TryGetLastAnnotation<GoPrivateAnnotation>(out var privateAnnotation); 361if (builder.Resource.TryGetLastAnnotation<GoModTidyAnnotation>(out _)) 385if (builder.Resource.TryGetLastAnnotation<GoModVendorBuilderAnnotation>(out var existingVendor)) 411if (builder.Resource.TryGetLastAnnotation<GoModVendorAnnotation>(out _)) 429if (builder.Resource.TryGetLastAnnotation<GoModTidyBuilderAnnotation>(out var tidyBuilder)) 457if (builder.Resource.TryGetLastAnnotation<GoModDownloadAnnotation>(out _)) 476if (builder.Resource.TryGetLastAnnotation<GoModVendorBuilderAnnotation>(out var vendorBuilder)) 480else if (builder.Resource.TryGetLastAnnotation<GoModTidyBuilderAnnotation>(out var tidyBuilder)) 505if (builder.Resource.TryGetLastAnnotation<GoVetToolAnnotation>(out _)) 741var packagePath = resource.TryGetLastAnnotation<GoPackagePathAnnotation>(out var packagePathAnnotation) 770if (ctx.Resource.TryGetLastAnnotation<GoRaceDetectorAnnotation>(out _)) 775if (ctx.Resource.TryGetLastAnnotation<GoBuildTagsAnnotation>(out var tagsAnnotation)) 780if (ctx.Resource.TryGetLastAnnotation<GoLdFlagsAnnotation>(out var ldFlagsAnnotation)) 785if (ctx.Resource.TryGetLastAnnotation<GoGcFlagsAnnotation>(out var gcFlagsAnnotation)) 790ctx.Args.Add(ctx.Resource.TryGetLastAnnotation<GoPackagePathAnnotation>(out var pkgAnnotation) 828if (includeRace && resource.TryGetLastAnnotation<GoRaceDetectorAnnotation>(out _)) 833if (resource.TryGetLastAnnotation<GoBuildTagsAnnotation>(out var tagsAnnotation)) 838if (resource.TryGetLastAnnotation<GoLdFlagsAnnotation>(out var ldFlagsAnnotation)) 843if (resource.TryGetLastAnnotation<GoGcFlagsAnnotation>(out var gcFlagsAnnotation))
Aspire.Hosting.Go.Tests (2)
AddGoAppTests.cs (1)
868Assert.False(app.Resource.TryGetLastAnnotation<DockerfileBuilderCallbackAnnotation>(out _),
GoPublicApiTests.cs (1)
258Assert.True(app.Resource.TryGetLastAnnotation<GoAppArgsAnnotation>(out var annotation));
Aspire.Hosting.Java (27)
JavaBuildToolResolver.cs (1)
69if (resource.TryGetLastAnnotation<WrapperAnnotation>(out var wrapper))
JavaDockerfileGenerator.cs (10)
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)) 1829var explicitMainClass = resource.TryGetLastAnnotation<JavaMainClassAnnotation>(out var mainClass) 1833if (!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 _); 1935if (resourceBuilder.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager)) 1950!containerResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) || 1952!containerResource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out var runScript)) 2027if (c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) && 2225if (c.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) && 2250if (resourceBuilder.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation)) 2270if (!resourceBuilder.Resource.TryGetLastAnnotation<SuppressPublishValidationAnnotation>(out var suppress)) 2422if (!resource.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out _)) 2514if (!resource.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out _)) 2819var hasRunScript = resource.TryGetLastAnnotation<JavaScriptRunScriptAnnotation>(out _); 2820var hasPackageManager = resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var pmAnnotation); 2822resource.TryGetLastAnnotation<DenoCommandLineAnnotation>(out var deno) 2884if (resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var pmAnnotation)) 3044if (!resource.Resource.TryGetLastAnnotation<JavaScriptPackageManagerAnnotation>(out var packageManager) || 3045!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)
1071Assert.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 (12)
Deployment\HelmDeploymentEngine.cs (2)
48if (environment.TryGetLastAnnotation<HelmReleaseNameAnnotation>(out var releaseAnnotation)) 72if (environment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation))
KubernetesEnvironmentResource.cs (4)
532if (environment.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)) 1436if (environment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation)) 1890if (environment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation)) 2194if (environment.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation))
KubernetesPublishingContext.cs (5)
84if (serviceResource.TargetResource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileBuildAnnotation) && 108if (serviceResource.TargetResource.TryGetLastAnnotation<KubernetesNodePoolAnnotation>(out var nodePoolAnnotation)) 436if (environment.TryGetLastAnnotation<HelmChartNameAnnotation>(out var nameAnnotation)) 446if (environment.TryGetLastAnnotation<HelmChartVersionAnnotation>(out var versionAnnotation)) 456if (environment.TryGetLastAnnotation<HelmChartDescriptionAnnotation>(out var descriptionAnnotation))
KubernetesResource.cs (1)
247if (resource.TryGetLastAnnotation<ProjectLaunchDefaultsAnnotation>(out var launchDefaults) &&
Aspire.Hosting.Kubernetes.Tests (18)
KubernetesDeployTests.cs (18)
62Assert.True(env.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var nsAnnotation)); 77Assert.True(env.TryGetLastAnnotation<HelmReleaseNameAnnotation>(out var annotation)); 92Assert.True(env.TryGetLastAnnotation<HelmChartVersionAnnotation>(out var annotation)); 112Assert.True(env.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out _)); 113Assert.True(env.TryGetLastAnnotation<HelmReleaseNameAnnotation>(out _)); 114Assert.True(env.TryGetLastAnnotation<HelmChartVersionAnnotation>(out _)); 130Assert.True(env.TryGetLastAnnotation<KubernetesNamespaceAnnotation>(out var annotation)); 147Assert.True(env.TryGetLastAnnotation<HelmReleaseNameAnnotation>(out var annotation)); 164Assert.True(env.TryGetLastAnnotation<HelmChartVersionAnnotation>(out var annotation)); 179Assert.True(env.TryGetLastAnnotation<HelmChartNameAnnotation>(out var annotation)); 194Assert.True(env.TryGetLastAnnotation<HelmChartDescriptionAnnotation>(out var annotation)); 211Assert.True(env.TryGetLastAnnotation<HelmChartNameAnnotation>(out var annotation)); 228Assert.True(env.TryGetLastAnnotation<HelmChartDescriptionAnnotation>(out var annotation)); 248Assert.True(env.TryGetLastAnnotation<HelmChartNameAnnotation>(out _)); 249Assert.True(env.TryGetLastAnnotation<HelmChartVersionAnnotation>(out _)); 250Assert.True(env.TryGetLastAnnotation<HelmChartDescriptionAnnotation>(out _)); 723Assert.True(env.TryGetLastAnnotation<HelmChartNameAnnotation>(out _)); 930Assert.True(container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var dta));
Aspire.Hosting.Maui (9)
Lifecycle\MauiBuildQueueEventSubscriber.cs (3)
78if (!parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var queueAnnotation)) 136var releaseBuildLockOnResourceRunning = !resource.TryGetLastAnnotation<MauiBuildInfoAnnotation>(out var buildInfo) 172if (!resource.TryGetLastAnnotation<MauiBuildInfoAnnotation>(out var buildInfo))
Lifecycle\UnsupportedPlatformEventSubscriber.cs (1)
31resource.TryGetLastAnnotation<UnsupportedPlatformAnnotation>(out var annotation))
MauiOtlpExtensions.cs (1)
75if (!parentBuilder.Resource.TryGetLastAnnotation<OtlpDevTunnelConfigurationAnnotation>(out var tunnelConfig))
Utilities\MauiAndroidEnvironmentAnnotation.cs (2)
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 (20)
MauiBuildQueueTests.cs (20)
37Assert.True(parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out _)); 63Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 81Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 226Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 380Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 461Assert.True(parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 480Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 547Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 625Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 644Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 714Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 771Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 798Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 839Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 886Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 928Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 976Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 1016Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 1106Assert.True(env.Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation)); 1347Parent.TryGetLastAnnotation<MauiBuildQueueAnnotation>(out var annotation);
Aspire.Hosting.MongoDB (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)
114this.TryGetLastAnnotation<MongoDBServerTlsModeAnnotation>(out var annotation)
ReplicaSet\MongoDBReplicaSetBuilderExtensions.cs (1)
428var memberKeyFile = member.Resource.TryGetLastAnnotation<MongoDBServerKeyFileAnnotation>(out var existingKeyFile) ? existingKeyFile : null;
Aspire.Hosting.PostgreSQL (2)
PostgresServerResource.cs (2)
67if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 83if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Python (18)
PythonAppResourceBuilderExtensions.cs (18)
440if (!context.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 447context.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnvironmentAnnotation); 464var isUsingUv = context.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var pkgMgr) && 534context.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 635context.Resource.TryGetLastAnnotation<DockerfileBaseImageAnnotation>(out var baseImageAnnotation); 875if (!builder.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 931if (!builder.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var entrypointAnnotation)) 965if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var annotation) || annotation.VirtualEnvironment is null) 1041if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1072if (!context.Resource.TryGetLastAnnotation<PythonEntrypointAnnotation>(out var existingAnnotation)) 1140if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1333if (!builder.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager) || 1334!builder.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installCommand)) 1368if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1449var shouldSkipInstallerWait = installerBuilder?.Resource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _) ?? false; 1488var isUsingUv = builder.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var pkgMgr) && 1498if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var pythonEnv) || 1528if (!builder.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var existing))
Aspire.Hosting.Python.Tests (26)
AddPythonAppTests.cs (26)
745Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 749Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 769Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 851Assert.True(installerResource.TryGetLastAnnotation<CertificateAuthorityCollectionAnnotation>(out var certAnnotation)); 876Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 880Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 907Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 911Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 2019Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2023Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 2053Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2057Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 2090Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2094Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonInstallCommandAnnotation>(out var installAnnotation)); 2114Assert.False(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out _)); 2220Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2255Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2259Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var envAnnotation)); 2295Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var envAnnotation)); 2325Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonEnvironmentAnnotation>(out var envAnnotation)); 2426Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2458Assert.True(pythonApp.Resource.TryGetLastAnnotation<PythonPackageManagerAnnotation>(out var packageManager)); 2495Assert.True(installerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 2528Assert.True(installerResource.TryGetLastAnnotation<ExplicitStartupAnnotation>(out _)); 2553Assert.True(installerResource.TryGetLastAnnotation<NameValidationPolicyAnnotation>(out var policy)); 2579Assert.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)
108if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 124if (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)
105if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation)) 121if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
Aspire.Hosting.Tests (5)
Orchestrator\ApplicationOrchestratorTests.cs (1)
1268if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
ProjectResourceTests.cs (1)
1097Assert.True(rebuilder.TryGetLastAnnotation<NameValidationPolicyAnnotation>(out var policy));
PublishAsConnectionStringTests.cs (1)
22Assert.True(redis.Resource.TryGetLastAnnotation<ManifestPublishingCallbackAnnotation>(out _));
Publishing\ResourceContainerImageManagerTests.cs (1)
1829if (context.Resource.TryGetLastAnnotation<DockerfileBuildAnnotation>(out var dockerfileAnnotation))
WithIconNameTests.cs (1)
99Assert.True(container.Resource.TryGetLastAnnotation<ResourceIconAnnotation>(out var lastAnnotation));
Aspire.Hosting.TestUtilities (1)
Utils\OtlpExporterActivationTestExtensions.cs (1)
14if (!builder.Resource.TryGetLastAnnotation<OtlpExporterAnnotation>(out var exporter))
Aspire.Hosting.Valkey (2)
ValkeyBuilderExtensions.cs (1)
174if (valkey.TryGetLastAnnotation<PersistenceAnnotation>(out var persistenceAnnotation))
ValkeyResource.cs (1)
54if (this.TryGetLastAnnotation<ConnectionStringRedirectAnnotation>(out var connectionStringAnnotation))
AzureAppService.AppHost (1)
AppHost.cs (1)
41if (context.Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var identity))
AzureContainerApps.AppHost (1)
AppHost.cs (1)
50if (context.Resource.TryGetLastAnnotation<AppIdentityAnnotation>(out var identity))
Terminals.AppHost (1)
TerminalInteractionCommands.cs (1)
557return container.TryGetLastAnnotation<ContainerNameAnnotation>(out var annotation)