3 instantiations of EndpointAnnotation
Aspire.Hosting (2)
ResourceBuilderExtensions.cs (2)
511endpoint = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName); 544var annotation = new EndpointAnnotation(
Aspire.Hosting.Azure.Tests (1)
AzureBicepResourceTests.cs (1)
2076=> new(storage.Resource, new EndpointAnnotation(ProtocolType.Tcp, name: name, targetPort: port));
193 references to EndpointAnnotation
Aspire.Hosting (54)
ApplicationModel\AllocatedEndpoint.cs (2)
22public AllocatedEndpoint(EndpointAnnotation endpoint, string address, int port, string? containerHostAddress = null, string? targetPortExpression = null) 38public EndpointAnnotation Endpoint { get; }
ApplicationModel\EndpointAnnotation.cs (2)
24/// Initializes a new instance of <see cref="EndpointAnnotation"/>. 44ModelName.ValidateName(nameof(EndpointAnnotation), name);
ApplicationModel\EndpointEnvironmentInjectionFilterAnnotation.cs (2)
9internal class EndpointEnvironmentInjectionFilterAnnotation(Func<EndpointAnnotation, bool> filter) : IResourceAnnotation 11public Func<EndpointAnnotation, bool> Filter { get; } = filter;
ApplicationModel\EndpointReference.cs (5)
14private EndpointAnnotation? _endpointAnnotation; 18internal EndpointAnnotation EndpointAnnotation => GetEndpointAnnotation() ?? throw new InvalidOperationException($"The endpoint `{EndpointName}` is not defined for the resource `{Resource.Name}`."); 109private EndpointAnnotation? GetEndpointAnnotation() => 110_endpointAnnotation ??= Resource.Annotations.OfType<EndpointAnnotation>().SingleOrDefault(a => StringComparers.EndpointAnnotationName.Equals(a.Name, EndpointName)); 119public EndpointReference(IResourceWithEndpoints owner, EndpointAnnotation endpoint)
ApplicationModel\ProjectResource.cs (3)
13internal Dictionary<EndpointAnnotation, string> KestrelEndpointAnnotationHosts { get; } = new(); 19internal EndpointAnnotation? DefaultHttpsEndpoint { get; set; } 23var endpoint = e.EndpointAnnotation;
ApplicationModel\ResourceExtensions.cs (5)
460public static bool TryGetEndpoints(this IResource resource, [NotNullWhen(true)] out IEnumerable<EndpointAnnotation>? endpoints) 468/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 469/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 472if (TryGetAnnotationsOfType<EndpointAnnotation>(resource, out var endpoints)) 483/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param>
BuiltInDistributedApplicationEventSubscriptionHandlers.cs (1)
52var httpEndpoints = resource.Annotations.OfType<EndpointAnnotation>().Where(sb => sb.UriScheme == "http" || sb.UriScheme == "https");
Dashboard\DashboardLifecycleHook.cs (3)
137var endpointAnnotations = dashboardResource.Annotations.OfType<EndpointAnnotation>().ToList(); 138foreach (var endpointAnnotation in endpointAnnotations) 279.OfType<EndpointAnnotation>()
Dcp\AppResource.cs (2)
29public EndpointAnnotation EndpointAnnotation { get; } 40public ServiceAppResource(IResource modelResource, Service service, EndpointAnnotation sba) : base(modelResource, service)
Dcp\DcpExecutor.cs (4)
709.Select(r => (ModelResource: r, Endpoints: r.Annotations.OfType<EndpointAnnotation>().ToArray())) 1338throw new InvalidOperationException($"The endpoint '{ea.Name}' for container resource '{modelResourceName}' must specify the {nameof(EndpointAnnotation.TargetPort)} value"); 1350throw new InvalidOperationException($"The endpoint '{ea.Name}' for resource '{modelResourceName}' is not using a proxy, and it has a value of {nameof(EndpointAnnotation.Port)} property that is different from the value of {nameof(EndpointAnnotation.TargetPort)} property. For proxy-less endpoints they must match.");
Dcp\DcpNameGenerator.cs (1)
81public string GetServiceName(IResource resource, EndpointAnnotation endpoint, bool hasMultipleEndpoints, HashSet<string> allServiceNames)
Devcontainers\DevcontainerPortForwardingLifecycleHook.cs (2)
42foreach (var endpoint in resourceWithEndpoints.Annotations.OfType<EndpointAnnotation>())
ProjectResourceBuilderExtensions.cs (9)
48/// to build the equivalent <see cref="EndpointAnnotation"/>. 361var adjustTransport = (EndpointAnnotation e, string? bindingLevelProtocols = null) => 497EndpointAnnotation GetOrCreateEndpointForScheme(string scheme) 499EndpointAnnotation? GetEndpoint(string scheme) => 500projectResource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(sb => sb.UriScheme == scheme || string.Equals(sb.Name, scheme, StringComparisons.EndpointAnnotationName)); 502var endpoint = GetEndpoint(scheme); 526var httpEndpoint = GetOrCreateEndpointForScheme("http"); 527var httpsEndpoint = GetOrCreateEndpointForScheme("https"); 614this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter)
Publishing\ManifestPublishingContext.cs (3)
389/// <see cref="EndpointAnnotation"/> entries in the <see cref="IResource.Annotations"/> 392/// <param name="resource">The <see cref="IResource"/> that contains <see cref="EndpointAnnotation"/> annotations.</param> 408foreach (var endpoint in endpoints)
ResourceBuilderExtensions.cs (10)
472/// The <see cref="WithEndpoint{T}(IResourceBuilder{T}, string, Action{EndpointAnnotation}, bool)"/> method allows 474/// other values to compatable/consistent values. For example setting the <see cref="EndpointAnnotation.Protocol"/> property 475/// of the endpoint annotation in the callback will not automatically change the <see cref="EndpointAnnotation.UriScheme"/>. 493public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string endpointName, Action<EndpointAnnotation> callback, bool createIfNotExists = true) where T : IResourceWithEndpoints 499var endpoint = builder.Resource.Annotations 500.OfType<EndpointAnnotation>() 544var annotation = new EndpointAnnotation( 553if (builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(sb => string.Equals(sb.Name, annotation.Name, StringComparisons.EndpointAnnotationName))) 644if (!builder.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 649foreach (var endpoint in endpoints)
Aspire.Hosting.Azure.AppContainers (3)
AzureContainerAppsInfrastructure.cs (3)
283foreach (var endpoint in endpoints) 411foreach (var e in httpIngress.Endpoints) 444foreach (var e in g.Endpoints)
Aspire.Hosting.Azure.Tests (19)
AzureCosmosDBExtensionsTests.cs (2)
29var endpointAnnotation = cosmos.Resource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault();
AzureEventHubsExtensionsTests.cs (1)
234eventHubs.Resource.Annotations.OfType<EndpointAnnotation>(),
AzureFunctionsTests.cs (14)
37Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 65Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 88Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 102Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 116Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 195Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 239Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation));
AzureServiceBusExtensionsTests.cs (1)
269serviceBus.Resource.Annotations.OfType<EndpointAnnotation>(),
AzureStorageExtensionsTests.cs (1)
129storage.Resource.Annotations.OfType<EndpointAnnotation>(),
Aspire.Hosting.Elasticsearch.Tests (6)
AddElasticsearchTests.cs (6)
29var endpoints = containerResource.Annotations.OfType<EndpointAnnotation>(); 32var primaryEndpoint = Assert.Single(endpoints, e => e.Name == "http"); 41var internalEndpoint = Assert.Single(endpoints, e => e.Name == "internal"); 90var endpoints = containerResource.Annotations.OfType<EndpointAnnotation>(); 93var primaryEndpoint = Assert.Single(endpoints, e => e.Name == "http"); 102var internalEndpoint = Assert.Single(endpoints, e => e.Name == "internal");
Aspire.Hosting.Garnet.Tests (4)
AddGarnetTests.cs (4)
28var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 56var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Kafka.Tests (5)
AddKafkaTests.cs (5)
28var endpoints = containerResource.Annotations.OfType<EndpointAnnotation>(); 31var primaryEndpoint = Assert.Single(endpoints, e => e.Name == "tcp"); 40var internalEndpoint = Assert.Single(endpoints, e => e.Name == "internal"); 176var kafkaUiEndpoint = kafkaUiResource.Annotations.OfType<EndpointAnnotation>().Single();
Aspire.Hosting.Keycloak.Tests (4)
KeycloakResourceBuilderTests.cs (4)
31var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>().Where(e => e.Name == defaultEndpointName)); 42var healthEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>().Where(e => e.Name == managementEndpointName));
Aspire.Hosting.Milvus.Tests (7)
AddMilvusTests.cs (7)
36var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 66var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 190Assert.Single(milvusResource.Annotations.OfType<EndpointAnnotation>()); 192var grpcEndpoint = milvusResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc");
Aspire.Hosting.MongoDB.Tests (6)
AddMongoDBTests.cs (6)
29var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 57var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 135var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.MySql.Tests (4)
AddMySqlTests.cs (4)
54var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 93var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Nats.Tests (4)
AddNatsTests.cs (4)
99var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 145var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Oracle.Tests (6)
AddOracleTests.cs (6)
53var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 92var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 174var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.PostgreSQL.Tests (8)
AddPostgresTests.cs (8)
63var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 117var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 208var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 428var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Qdrant.Tests (11)
AddQdrantTests.cs (11)
56var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 95var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 128var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 289Assert.Equal(2, qdrantResource.Annotations.OfType<EndpointAnnotation>().Count()); 291var grpcEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc"); 299var httpEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "http");
Aspire.Hosting.RabbitMQ.Tests (4)
AddRabbitMQTests.cs (4)
56var primaryEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>().Where(e => e.Name == "tcp")); 67var mangementEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>().Where(e => e.Name == "management"));
Aspire.Hosting.Redis.Tests (8)
AddRedisTests.cs (8)
36var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 64var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 303var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 317var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Seq.Tests (4)
AddSeqTests.cs (4)
27var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 55var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.SqlServer.Tests (2)
AddSqlServerTests.cs (2)
49var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Tests (28)
AsHttp2ServiceTests.cs (3)
25r => r.Annotations.OfType<EndpointAnnotation>() 45var httpEndpoints = testProgram.ServiceABuilder.Resource.Annotations.OfType<EndpointAnnotation>().Where(sb => sb.UriScheme == "http" || sb.UriScheme == "https"); 63var endpoints = testProgram.ServiceABuilder.Resource.Annotations.OfType<EndpointAnnotation>();
Dashboard\DashboardResourceTests.cs (2)
314var endpointAnnotation = Assert.Single(container.Annotations.OfType<EndpointAnnotation>());
KestrelConfigTests.cs (6)
25resource.Annotations.OfType<EndpointAnnotation>(), 62resource.Annotations.OfType<EndpointAnnotation>(), 94resource.Annotations.OfType<EndpointAnnotation>(), 111resource.Annotations.OfType<EndpointAnnotation>(), 461foreach (var endpoint in resource.Annotations.OfType<EndpointAnnotation>())
ProjectResourceTests.cs (1)
251resource.Annotations.OfType<EndpointAnnotation>(),
SlimTestProgramTests.cs (4)
59var endpoint = projectBuilders.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 78var endpoint = projectBuilders.Resource.Annotations.OfType<EndpointAnnotation>().Single();
WithEndpointTests.cs (12)
29var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 46var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 81var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 119Assert.False(projectA.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var annotations)); 136Assert.True(projectA.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out _)); 153Assert.True(projectA.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out _)); 218var endpoints = resource.Annotations.OfType<EndpointAnnotation>().ToArray(); 608var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>()
Aspire.Hosting.Valkey.Tests (4)
AddValkeyTests.cs (4)
28var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 56var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
TestProject.AppHost (2)
TestProgram.cs (2)
168foreach (var endpoint in project.Annotations.OfType<EndpointAnnotation>())