3 instantiations of EndpointAnnotation
Aspire.Hosting (2)
ResourceBuilderExtensions.cs (2)
543endpoint = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName); 576var annotation = new EndpointAnnotation(
Aspire.Hosting.Azure.Tests (1)
AzureStorageExtensionsTests.cs (1)
313=> new(storage.Resource, new EndpointAnnotation(ProtocolType.Tcp, name: name, targetPort: port));
217 references to EndpointAnnotation
Aspire.Hosting (62)
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)
17internal Dictionary<EndpointAnnotation, string> KestrelEndpointAnnotationHosts { get; } = new(); 23internal EndpointAnnotation? DefaultHttpsEndpoint { get; set; } 27var endpoint = e.EndpointAnnotation;
ApplicationModel\ResourceExtensions.cs (5)
483public static bool TryGetEndpoints(this IResource resource, [NotNullWhen(true)] out IEnumerable<EndpointAnnotation>? endpoints) 502/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 503/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 506if (TryGetAnnotationsOfType<EndpointAnnotation>(resource, out var endpoints)) 517/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param>
Backchannel\AppHostRpcTarget.cs (1)
70endpoints = Enumerable.Empty<EndpointAnnotation>();
BuiltInDistributedApplicationEventSubscriptionHandlers.cs (2)
52var httpEndpoints = resource.Annotations.OfType<EndpointAnnotation>().Where(sb => sb.UriScheme == "http" || sb.UriScheme == "https"); 53foreach (var httpEndpoint in httpEndpoints)
Dashboard\DashboardLifecycleHook.cs (4)
142var endpointAnnotations = dashboardResource.Annotations.OfType<EndpointAnnotation>().ToList(); 143foreach (var endpointAnnotation in endpointAnnotations) 327.OfType<EndpointAnnotation>() 331foreach (var endpoint in allResourceEndpoints)
Dcp\AppResource.cs (2)
29public EndpointAnnotation EndpointAnnotation { get; } 40public ServiceAppResource(IResource modelResource, Service service, EndpointAnnotation sba) : base(modelResource, service)
Dcp\DcpExecutor.cs (7)
758.Select(r => (ModelResource: r, Endpoints: r.Annotations.OfType<EndpointAnnotation>().ToArray())) 769foreach (var endpoint in endpoints) 1385var ea = sp.EndpointAnnotation; 1391throw new InvalidOperationException($"The endpoint '{ea.Name}' for container resource '{modelResourceName}' must specify the {nameof(EndpointAnnotation.TargetPort)} value"); 1403throw 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."); 1766var ea = sp.EndpointAnnotation;
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>())
Orchestrator\ApplicationOrchestrator.cs (1)
189foreach (var endpoint in endpoints)
ProjectResourceBuilderExtensions.cs (10)
48/// to build the equivalent <see cref="EndpointAnnotation"/>. 361var adjustTransport = (EndpointAnnotation e, string? bindingLevelProtocols = null) => 469foreach (var endpoint in endpoints) 529EndpointAnnotation GetOrCreateEndpointForScheme(string scheme) 531EndpointAnnotation? GetEndpoint(string scheme) => 532projectResource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(sb => sb.UriScheme == scheme || string.Equals(sb.Name, scheme, StringComparisons.EndpointAnnotationName)); 534var endpoint = GetEndpoint(scheme); 558var httpEndpoint = GetOrCreateEndpointForScheme("http"); 559var httpsEndpoint = GetOrCreateEndpointForScheme("https"); 646this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter)
Publishing\ManifestPublishingContext.cs (3)
390/// <see cref="EndpointAnnotation"/> entries in the <see cref="IResource.Annotations"/> 393/// <param name="resource">The <see cref="IResource"/> that contains <see cref="EndpointAnnotation"/> annotations.</param> 409foreach (var endpoint in endpoints)
ResourceBuilderExtensions.cs (10)
504/// The <see cref="WithEndpoint{T}(IResourceBuilder{T}, string, Action{EndpointAnnotation}, bool)"/> method allows 506/// other values to compatible/consistent values. For example setting the <see cref="EndpointAnnotation.Protocol"/> property 507/// of the endpoint annotation in the callback will not automatically change the <see cref="EndpointAnnotation.UriScheme"/>. 525public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string endpointName, Action<EndpointAnnotation> callback, bool createIfNotExists = true) where T : IResourceWithEndpoints 531var endpoint = builder.Resource.Annotations 532.OfType<EndpointAnnotation>() 576var annotation = new EndpointAnnotation( 585if (builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(sb => string.Equals(sb.Name, annotation.Name, StringComparisons.EndpointAnnotationName))) 676if (!builder.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 681foreach (var endpoint in endpoints)
Aspire.Hosting.Azure.AppContainers (3)
ContainerAppContext.cs (3)
213foreach (var endpoint in endpoints) 341foreach (var e in httpIngress.Endpoints) 374foreach (var e in g.Endpoints)
Aspire.Hosting.Azure.AppService (1)
AzureAppServiceWebsiteContext.cs (1)
90foreach (var endpoint in endpoints)
Aspire.Hosting.Azure.Tests (25)
AzureCosmosDBExtensionsTests.cs (2)
32var endpointAnnotation = cosmos.Resource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault();
AzureEventHubsExtensionsTests.cs (1)
242var endpoints = eventHubs.Resource.Annotations.OfType<EndpointAnnotation>().ToList();
AzureFunctionsTests.cs (14)
50Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 78Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 101Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 115Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 129Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 213Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 257Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation));
AzurePostgresExtensionsTests.cs (2)
180var endpoint = Assert.Single(innerPostgres.Resource.Annotations.OfType<EndpointAnnotation>());
AzureRedisExtensionsTests.cs (2)
128var endpoint = Assert.Single(redisResource.Annotations.OfType<EndpointAnnotation>());
AzureServiceBusExtensionsTests.cs (1)
164serviceBus.Resource.Annotations.OfType<EndpointAnnotation>(),
AzureSqlExtensionsTests.cs (2)
149var endpoint = Assert.Single(innerSql.Resource.Annotations.OfType<EndpointAnnotation>());
AzureStorageExtensionsTests.cs (1)
132storage.Resource.Annotations.OfType<EndpointAnnotation>(),
Aspire.Hosting.Docker (2)
DockerComposeEnvironmentContext.cs (2)
48string ResolveTargetPort(EndpointAnnotation endpoint) 69foreach (var endpoint in endpoints)
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>(), e => e.Name == defaultEndpointName); 42var healthEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == managementEndpointName);
Aspire.Hosting.Kubernetes (2)
KubernetesResource.cs (2)
165foreach (var endpoint in endpoints) 179private void GenerateDefaultProjectEndpointMapping(EndpointAnnotation endpoint)
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 (10)
AddPostgresTests.cs (10)
63var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 117var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 208var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 427var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 654var 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>(), e => e.Name == "tcp"); 67var mangementEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "management");
Aspire.Hosting.Redis.Tests (10)
AddRedisTests.cs (10)
36var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 64var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 413var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 427var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 439var 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 (4)
AddSqlServerTests.cs (4)
49var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 261var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Tests (31)
AsHttp2ServiceTests.cs (6)
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>(); 64var tcpBinding = endpoints.Single(sb => sb.UriScheme == "tcp"); 67var httpsBinding = endpoints.Single(sb => sb.UriScheme == "https"); 70var httpBinding = endpoints.Single(sb => sb.UriScheme == "http");
Dashboard\DashboardResourceTests.cs (2)
325var 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)
254resource.Annotations.OfType<EndpointAnnotation>(),
SlimTestProgramTests.cs (4)
56var endpoint = projectBuilders.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 74var 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>());
Aspire.Hosting.Yarp.Tests (2)
AddYarpTests.cs (2)
22var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
TestProject.AppHost (2)
TestProgram.cs (2)
169foreach (var endpoint in project.Annotations.OfType<EndpointAnnotation>())