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();
80 references to Annotations
Aspire.Hosting (32)
ApplicationModel\CommandsConfigurationExtensions.cs (3)
22resource.Annotations.Add(new ResourceCommandAnnotation( 54resource.Annotations.Add(new ResourceCommandAnnotation( 86resource.Annotations.Add(new ResourceCommandAnnotation(
ApplicationModel\CustomResourceSnapshot.cs (1)
340foreach (var annotation in resource.Annotations.OfType<ResourceRelationshipAnnotation>())
ApplicationModel\EndpointReference.cs (1)
109_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)
22if (resource.Annotations.OfType<T>().LastOrDefault() is { } lastAnnotation) 43var matchingTypeAnnotations = resource.Annotations.OfType<T>().ToArray(); 65return resource.Annotations.Any(a => a is T); 83foreach (var annotation in resource.Annotations.OfType<T>()) 248/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 279if (resource.Annotations.OfType<ContainerImageAnnotation>().LastOrDefault() is { } imageAnnotation)
ApplicationModel\ResourceNotificationService.cs (2)
398foreach (var annotation in resource.Annotations.OfType<ResourceCommandAnnotation>()) 485if (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); 156dashboardResource.Annotations.Add(new ResourceSnapshotAnnotation(snapshot)); 158dashboardResource.Annotations.Add(new EnvironmentCallbackAnnotation(async context =>
Dcp\ApplicationExecutor.cs (1)
1773if (modelContainerResource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } dockerfileBuildAnnotation)
Dcp\DcpNameGenerator.cs (1)
60resource.Annotations.Add(new DcpInstancesAnnotation(instances));
Devcontainers\DevcontainerPortForwardingLifecycleHook.cs (1)
51foreach (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)
387/// <see cref="EndpointAnnotation"/> entries in the <see cref="IResource.Annotations"/>
ResourceBuilderExtensions.cs (6)
435var endpointReferenceAnnotation = builder.Resource.Annotations 477var endpoint = builder.Resource.Annotations 491builder.Resource.Annotations.Add(endpoint); 530if (builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(sb => string.Equals(sb.Name, annotation.Name, StringComparisons.EndpointAnnotationName))) 1002var existingAnnotation = builder.Resource.Annotations.OfType<ResourceCommandAnnotation>().SingleOrDefault(a => a.Name == name); 1005builder.Resource.Annotations.Remove(existingAnnotation);
Aspire.Hosting.Azure (1)
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 (2)
ContainerResourceTests.cs (2)
27var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 46var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>());
Aspire.Hosting.Dapr (5)
DaprDistributedApplicationLifecycleHook.cs (5)
56var sidecarOptionsAnnotation = daprSidecar.Annotations.OfType<DaprSidecarOptionsAnnotation>().LastOrDefault(); 73var componentReferenceAnnotations = resource.Annotations.OfType<DaprComponentReferenceAnnotation>(); 155resource.Annotations.Add( 226daprCli.Annotations.AddRange(daprSidecar.Annotations.OfType<EnvironmentCallbackAnnotation>()); 231daprSidecar.Annotations.Add(
Aspire.Hosting.Kafka.Tests (1)
AddKafkaTests.cs (1)
176var kafkaUiEndpoint = kafkaUiResource.Annotations.OfType<EndpointAnnotation>().Single();
Aspire.Hosting.Milvus.Tests (4)
AddMilvusTests.cs (4)
32var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 37var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 63var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 68var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>()
Aspire.Hosting.MySql.Tests (4)
AddMySqlTests.cs (4)
89var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 94var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 261var volume = container.Annotations.OfType<ContainerMountAnnotation>().Single(); 279var 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>()); 88var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 93var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 171var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 176var 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>()); 113var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 118var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 205var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 210var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 381var volume = container.Annotations.OfType<ContainerMountAnnotation>().Single(); 436var imageAnnotation = container.Annotations.OfType<ContainerImageAnnotation>().Single(); 464var volume = pgadmin.Annotations.OfType<ContainerMountAnnotation>().Single(); 511var 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>() 124var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 129var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>()
Aspire.Hosting.Testing.Tests (1)
TestingBuilderTests.cs (1)
97var containerImageAnnotation = resource.Annotations.OfType<ContainerImageAnnotation>().FirstOrDefault();
Aspire.Hosting.Tests (3)
Dashboard\DashboardResourceTests.cs (1)
314var endpointAnnotation = Assert.Single(container.Annotations.OfType<EndpointAnnotation>());
Dcp\ApplicationExecutorTests.cs (1)
1037var 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)
63.SelectMany(r => r.Annotations.OfType<ContainerImageAnnotation>()