7 instantiations of EndpointAnnotation
Aspire.Hosting (2)
ResourceBuilderExtensions.cs (2)
489endpoint = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName); 521var annotation = new EndpointAnnotation(
Aspire.Hosting.Azure.Tests (1)
AzureBicepResourceTests.cs (1)
1854=> new(storage.Resource, new EndpointAnnotation(ProtocolType.Tcp, name: name, targetPort: port));
Aspire.Hosting.Dapr (4)
DaprDistributedApplicationLifecycleHook.cs (4)
174daprCli.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "grpc", port: sidecarOptions?.DaprGrpcPort)); 175daprCli.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", port: sidecarOptions?.DaprHttpPort)); 176daprCli.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "metrics", port: sidecarOptions?.MetricsPort)); 179daprCli.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: "profile", port: sidecarOptions?.ProfilePort, uriScheme: "http"));
179 references to EndpointAnnotation
Aspire.Hosting (51)
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}`."); 108private EndpointAnnotation? GetEndpointAnnotation() => 109_endpointAnnotation ??= Resource.Annotations.OfType<EndpointAnnotation>().SingleOrDefault(a => StringComparers.EndpointAnnotationName.Equals(a.Name, EndpointName)); 118public 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)
239public static bool TryGetEndpoints(this IResource resource, [NotNullWhen(true)] out IEnumerable<EndpointAnnotation>? endpoints) 247/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 248/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 251if (TryGetAnnotationsOfType<EndpointAnnotation>(resource, out var endpoints)) 262/// <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) 275.OfType<EndpointAnnotation>()
Dcp\ApplicationExecutor.cs (7)
52public EndpointAnnotation EndpointAnnotation { get; } 63public ServiceAppResource(IResource modelResource, Service service, EndpointAnnotation sba) : base(modelResource, service) 1023.Select(r => (ModelResource: r, Endpoints: r.Annotations.OfType<EndpointAnnotation>())) 1622var ea = sp.EndpointAnnotation; 1866throw new InvalidOperationException($"The endpoint '{ea.Name}' for container resource '{modelResourceName}' must specify the {nameof(EndpointAnnotation.TargetPort)} value"); 1878throw 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.");
Devcontainers\DevcontainerPortForwardingLifecycleHook.cs (2)
51foreach (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) => { 496EndpointAnnotation GetOrCreateEndpointForScheme(string scheme) 498EndpointAnnotation? GetEndpoint(string scheme) => 499projectResource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(sb => sb.UriScheme == scheme || string.Equals(sb.Name, scheme, StringComparisons.EndpointAnnotationName)); 501var endpoint = GetEndpoint(scheme); 525var httpEndpoint = GetOrCreateEndpointForScheme("http"); 526var httpsEndpoint = GetOrCreateEndpointForScheme("https"); 613this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter)
Publishing\ManifestPublishingContext.cs (3)
387/// <see cref="EndpointAnnotation"/> entries in the <see cref="IResource.Annotations"/> 390/// <param name="resource">The <see cref="IResource"/> that contains <see cref="EndpointAnnotation"/> annotations.</param> 406foreach (var endpoint in endpoints)
ResourceBuilderExtensions.cs (7)
471public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string endpointName, Action<EndpointAnnotation> callback, bool createIfNotExists = true) where T : IResourceWithEndpoints 477var endpoint = builder.Resource.Annotations 478.OfType<EndpointAnnotation>() 521var annotation = new EndpointAnnotation( 530if (builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(sb => string.Equals(sb.Name, annotation.Name, StringComparisons.EndpointAnnotationName))) 601if (!builder.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 606foreach (var endpoint in endpoints)
Aspire.Hosting.Azure.AppContainers (3)
AzureContainerAppsInfrastructure.cs (3)
284foreach (var endpoint in endpoints) 412foreach (var e in httpIngress.Endpoints) 445foreach (var e in g.Endpoints)
Aspire.Hosting.Azure.Tests (14)
AzureEventHubsExtensionsTests.cs (1)
180eventHubs.Resource.Annotations.OfType<EndpointAnnotation>(),
AzureFunctionsTests.cs (10)
36Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 51Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 65Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 79Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 93Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation));
AzureResourceExtensionsTests.cs (3)
130storage.Resource.Annotations.OfType<EndpointAnnotation>(), 151var endpointAnnotation = cosmos.Resource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault();
Aspire.Hosting.Dapr.Tests (2)
DaprTests.cs (2)
54foreach (var e in endpoints) 153foreach (var e in endpoints)
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"); 91var endpoints = containerResource.Annotations.OfType<EndpointAnnotation>(); 94var primaryEndpoint = Assert.Single(endpoints, e => e.Name == "http"); 103var internalEndpoint = Assert.Single(endpoints, e => e.Name == "internal");
Aspire.Hosting.Garnet.Tests (4)
AddGarnetTests.cs (4)
27var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 55var 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 (2)
KeycloakResourceBuilderTests.cs (2)
29var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Milvus.Tests (7)
AddMilvusTests.cs (7)
37var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 68var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 196Assert.Single(milvusResource.Annotations.OfType<EndpointAnnotation>()); 198var 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>()); 94var 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>()); 93var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 176var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.PostgreSQL.Tests (8)
AddPostgresTests.cs (8)
63var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 118var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 210var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 425var 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>() 129var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 292Assert.Equal(2, qdrantResource.Annotations.OfType<EndpointAnnotation>().Count()); 294var grpcEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc"); 302var 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>()); 188var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 202var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.SqlServer.Tests (2)
AddSqlServerTests.cs (2)
49var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Tests (26)
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)
56var endpoint = projectBuilders.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 74var endpoint = projectBuilders.Resource.Annotations.OfType<EndpointAnnotation>().Single();
WithEndpointTests.cs (10)
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();
Aspire.Hosting.Valkey.Tests (4)
AddValkeyTests.cs (4)
27var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 55var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
TestProject.AppHost (2)
TestProgram.cs (2)
155foreach (var endpoint in project.Annotations.OfType<EndpointAnnotation>())