3 implementations of Annotations
Aspire.Hosting (1)
ApplicationModel\Resource.cs (1)
22public virtual ResourceAnnotationCollection Annotations { get; } = new();
Aspire.Hosting.Azure.Sql (1)
AzureSqlServerResource.cs (1)
71public override ResourceAnnotationCollection Annotations => InnerResource?.Annotations ?? base.Annotations;
Aspire.Hosting.Tests (1)
DistributedApplicationBuilderTests.cs (1)
176public ResourceAnnotationCollection Annotations => throw new NotImplementedException();
79 references to Annotations
Aspire.Hosting (32)
ApplicationModel\CommandsConfigurationExtensions.cs (3)
19resource.Annotations.Add(new ResourceCommandAnnotation( 52resource.Annotations.Add(new ResourceCommandAnnotation( 85resource.Annotations.Add(new ResourceCommandAnnotation(
ApplicationModel\CustomResourceSnapshot.cs (1)
392foreach (var annotation in resource.Annotations.OfType<ResourceRelationshipAnnotation>())
ApplicationModel\EndpointReference.cs (1)
110_endpointAnnotation ??= Resource.Annotations.OfType<EndpointAnnotation>().SingleOrDefault(a => StringComparers.EndpointAnnotationName.Equals(a.Name, EndpointName));
ApplicationModel\ResourceAnnotationMutationBehavior.cs (1)
8/// method when adding an annotation to the <see cref="IResource.Annotations"/> collection of a resource.
ApplicationModel\ResourceExtensions.cs (6)
24if (resource.Annotations.OfType<T>().LastOrDefault() is { } lastAnnotation) 45var matchingTypeAnnotations = resource.Annotations.OfType<T>().ToArray(); 67return resource.Annotations.Any(a => a is T); 85foreach (var annotation in resource.Annotations.OfType<T>()) 469/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 500if (resource.Annotations.OfType<ContainerImageAnnotation>().LastOrDefault() is { } imageAnnotation)
ApplicationModel\ResourceNotificationService.cs (2)
610foreach (var annotation in resource.Annotations.OfType<ResourceCommandAnnotation>()) 697if (resource.Annotations.OfType<ResourceSnapshotAnnotation>().LastOrDefault() is { } annotation)
ContainerResourceExtensions.cs (1)
40return resource.Annotations.OfType<ContainerImageAnnotation>().Any();
Dashboard\DashboardLifecycleHook.cs (5)
133dashboardResource.Annotations.Add(new ExcludeLifecycleCommandsAnnotation()); 137var endpointAnnotations = dashboardResource.Annotations.OfType<EndpointAnnotation>().ToList(); 140dashboardResource.Annotations.Remove(endpointAnnotation); 171dashboardResource.Annotations.Add(new ResourceSnapshotAnnotation(snapshot)); 173dashboardResource.Annotations.Add(new EnvironmentCallbackAnnotation(async context =>
Dcp\DcpExecutor.cs (1)
1244if (modelContainerResource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } dockerfileBuildAnnotation)
Dcp\DcpNameGenerator.cs (1)
60resource.Annotations.Add(new DcpInstancesAnnotation(instances));
Devcontainers\DevcontainerPortForwardingLifecycleHook.cs (1)
42foreach (var endpoint in resourceWithEndpoints.Annotations.OfType<EndpointAnnotation>())
IDistributedApplicationBuilder.cs (1)
175/// Calling extension methods on the <see cref="IResourceBuilder{T}"/> typically results in modifications to the <see cref="IResource.Annotations"/>
OtlpConfigurationExtensions.cs (1)
37resource.Annotations.Add(new EnvironmentCallbackAnnotation(async context =>
Publishing\ManifestPublishingContext.cs (1)
389/// <see cref="EndpointAnnotation"/> entries in the <see cref="IResource.Annotations"/>
ResourceBuilderExtensions.cs (6)
435var endpointReferenceAnnotation = builder.Resource.Annotations 499var endpoint = builder.Resource.Annotations 513builder.Resource.Annotations.Add(endpoint); 553if (builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(sb => string.Equals(sb.Name, annotation.Name, StringComparisons.EndpointAnnotationName))) 1133var existingAnnotation = builder.Resource.Annotations.OfType<ResourceCommandAnnotation>().SingleOrDefault(a => a.Name == name); 1136builder.Resource.Annotations.Remove(existingAnnotation);
Aspire.Hosting.Azure (2)
ExistingAzureResourceExtensions.cs (1)
24return resource.Annotations.OfType<ExistingAzureResourceAnnotation>().LastOrDefault() is not null;
Provisioning\Provisioners\AzureProvisioner.cs (1)
65else if (resource.Annotations.OfType<AzureBicepResourceAnnotation>().SingleOrDefault() is { } annotation)
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppsInfrastructure.cs (1)
57r.Annotations.Add(new DeploymentTargetAnnotation(containerApp));
Aspire.Hosting.Containers.Tests (5)
ContainerResourceBuilderTests.cs (1)
221var containerImage = builder.Resource.Annotations.OfType<ContainerImageAnnotation>().Single();
ContainerResourceTests.cs (4)
27var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 46var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 65var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 85var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>());
Aspire.Hosting.Kafka.Tests (1)
AddKafkaTests.cs (1)
176var kafkaUiEndpoint = kafkaUiResource.Annotations.OfType<EndpointAnnotation>().Single();
Aspire.Hosting.Milvus.Tests (4)
AddMilvusTests.cs (4)
31var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 36var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 61var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 66var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>()
Aspire.Hosting.MySql.Tests (4)
AddMySqlTests.cs (4)
88var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 93var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 249Assert.Empty(container.Annotations.OfType<ContainerMountAnnotation>()); 277var volume = myAdmin.Annotations.OfType<ContainerMountAnnotation>().Single();
Aspire.Hosting.Oracle.Tests (6)
AddOracleTests.cs (6)
48var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 53var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 87var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 92var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 169var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 174var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.PostgreSQL.Tests (10)
AddPostgresTests.cs (10)
58var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 63var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 112var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 117var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 203var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 208var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 384var volume = container.Annotations.OfType<ContainerMountAnnotation>().Single(); 439var imageAnnotation = container.Annotations.OfType<ContainerImageAnnotation>().Single(); 475var volume = pgadmin.Annotations.OfType<ContainerMountAnnotation>().Single(); 536var volume = pgadmin.Annotations.OfType<ContainerMountAnnotation>().Single();
Aspire.Hosting.Qdrant.Tests (6)
AddQdrantTests.cs (6)
51var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 56var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 90var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 95var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 123var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 128var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>()
Aspire.Hosting.Testing.Tests (1)
TestingBuilderTests.cs (1)
103var containerImageAnnotation = resource.Annotations.OfType<ContainerImageAnnotation>().FirstOrDefault();
Aspire.Hosting.Tests (3)
Dashboard\DashboardResourceTests.cs (1)
314var endpointAnnotation = Assert.Single(container.Annotations.OfType<EndpointAnnotation>());
Dcp\DcpExecutorTests.cs (1)
1205var commandAnnotations = resource.Annotations.OfType<ResourceCommandAnnotation>().ToList();
ResourceNotificationTests.cs (1)
29var annotation = custom.Resource.Annotations.OfType<ResourceSnapshotAnnotation>().SingleOrDefault();
Aspire.Playground.Tests (4)
Infrastructure\DistributedApplicationExtensions.cs (3)
52var allResourceNamedVolumes = builder.Resources.SelectMany(r => r.Annotations 75resource.Annotations.Remove(volume); 76resource.Annotations.Add(newMount);
Infrastructure\DistributedApplicationTestFactory.cs (1)
56.SelectMany(r => r.Annotations.OfType<ContainerImageAnnotation>()