6 instantiations of EndpointAnnotation
Aspire.Hosting (2)
ResourceBuilderExtensions.cs (2)
416endpoint = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName); 446var annotation = new EndpointAnnotation(
Aspire.Hosting.Dapr (4)
DaprDistributedApplicationLifecycleHook.cs (4)
159daprCli.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "grpc", port: sidecarOptions?.DaprGrpcPort)); 160daprCli.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", port: sidecarOptions?.DaprHttpPort)); 161daprCli.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "metrics", port: sidecarOptions?.MetricsPort)); 164daprCli.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: "profile", port: sidecarOptions?.ProfilePort, uriScheme: "http"));
164 references to EndpointAnnotation
Aspire.Hosting (49)
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)
157public static bool TryGetEndpoints(this IResource resource, [NotNullWhen(true)] out IEnumerable<EndpointAnnotation>? endpoints) 165/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 166/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 169if (TryGetAnnotationsOfType<EndpointAnnotation>(resource, out var endpoints)) 180/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param>
BuiltInDistributedApplicationEventSubscriptionHandlers.cs (1)
26var httpEndpoints = resource.Annotations.OfType<EndpointAnnotation>().Where(sb => sb.UriScheme == "http" || sb.UriScheme == "https");
Dashboard\DashboardLifecycleHook.cs (3)
115var endpointAnnotations = dashboardResource.Annotations.OfType<EndpointAnnotation>().ToList(); 116foreach (var endpointAnnotation in endpointAnnotations) 170.OfType<EndpointAnnotation>()
Dcp\ApplicationExecutor.cs (7)
46public EndpointAnnotation EndpointAnnotation { get; } 57public ServiceAppResource(IResource modelResource, Service service, EndpointAnnotation sba) : base(modelResource, service) 973.Select(r => (ModelResource: r, Endpoints: r.Annotations.OfType<EndpointAnnotation>())) 1519var ea = sp.EndpointAnnotation; 1758throw new InvalidOperationException($"The endpoint '{ea.Name}' for container resource '{modelResourceName}' must specify the {nameof(EndpointAnnotation.TargetPort)} value"); 1770throw 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.");
ProjectResourceBuilderExtensions.cs (9)
48/// to build the equivalent <see cref="EndpointAnnotation"/>. 338var adjustTransport = (EndpointAnnotation e, string? bindingLevelProtocols = null) => { 473EndpointAnnotation GetOrCreateEndpointForScheme(string scheme) 475EndpointAnnotation? GetEndpoint(string scheme) => 476projectResource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(sb => sb.UriScheme == scheme || string.Equals(sb.Name, scheme, StringComparisons.EndpointAnnotationName)); 478var endpoint = GetEndpoint(scheme); 502var httpEndpoint = GetOrCreateEndpointForScheme("http"); 503var httpsEndpoint = GetOrCreateEndpointForScheme("https"); 586this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter)
Publishing\ManifestPublishingContext.cs (3)
347/// <see cref="EndpointAnnotation"/> entries in the <see cref="IResource.Annotations"/> 350/// <param name="resource">The <see cref="IResource"/> that contains <see cref="EndpointAnnotation"/> annotations.</param> 366foreach (var endpoint in endpoints)
ResourceBuilderExtensions.cs (7)
402public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Action<EndpointAnnotation> callback, bool createIfNotExists = true) where T : IResourceWithEndpoints 404var endpoint = builder.Resource.Annotations 405.OfType<EndpointAnnotation>() 446var annotation = new EndpointAnnotation( 455if (builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(sb => string.Equals(sb.Name, annotation.Name, StringComparisons.EndpointAnnotationName))) 520if (!builder.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 525foreach (var endpoint in endpoints)
Aspire.Hosting.Azure.Tests (4)
AzureEventHubsExtensionsTests.cs (1)
94eventHubs.Resource.Annotations.OfType<EndpointAnnotation>(),
AzureResourceExtensionsTests.cs (3)
128storage.Resource.Annotations.OfType<EndpointAnnotation>(), 149var 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)
28var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 73var 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)
291var endpointAnnotation = Assert.Single(container.Annotations.OfType<EndpointAnnotation>());
KestrelConfigTests.cs (6)
24resource.Annotations.OfType<EndpointAnnotation>(), 61resource.Annotations.OfType<EndpointAnnotation>(), 93resource.Annotations.OfType<EndpointAnnotation>(), 110resource.Annotations.OfType<EndpointAnnotation>(), 460foreach (var endpoint in resource.Annotations.OfType<EndpointAnnotation>())
ProjectResourceTests.cs (1)
250resource.Annotations.OfType<EndpointAnnotation>(),
SlimTestProgramTests.cs (4)
55var endpoint = projectBuilders.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 73var endpoint = projectBuilders.Resource.Annotations.OfType<EndpointAnnotation>().Single();
WithEndpointTests.cs (10)
28var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 45var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 80var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 118Assert.False(projectA.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var annotations)); 135Assert.True(projectA.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out _)); 152Assert.True(projectA.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out _)); 217var 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)
165foreach (var endpoint in project.Annotations.OfType<EndpointAnnotation>())