38 instantiations of EndpointAnnotation
Aspire.Hosting (6)
Dashboard\DashboardEventHandlers.cs (4)
416dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: address.Scheme, port: address.Port, isProxied: true) 425dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: address.Scheme, port: address.Port, isProxied: true, transport: "http2") 434dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpHttpEndpointName, uriScheme: address.Scheme, port: address.Port, isProxied: true) 443dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: McpEndpointName, uriScheme: address.Scheme, port: address.Port, isProxied: true)
ResourceBuilderExtensions.cs (2)
900endpoint = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, networkID: KnownNetworkIdentifiers.LocalhostNetwork); 938var annotation = new EndpointAnnotation(
Aspire.Hosting.Azure.Tests (1)
AzureStorageExtensionsTests.cs (1)
420=> new(storage.Resource, new EndpointAnnotation(ProtocolType.Tcp, name: name, targetPort: port));
Aspire.Hosting.DevTunnels (1)
DevTunnelResource.cs (1)
65TunnelEndpointAnnotation = new EndpointAnnotation(
Aspire.Hosting.Maui (1)
Otlp\OtlpLoopbackResource.cs (1)
29Annotations.Add(new EndpointAnnotation(
Aspire.Hosting.Tests (29)
ApplicationModel\McpServerEndpointAnnotationTests.cs (8)
73var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 88var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 103var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 119var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 135var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 150var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 165var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 182var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https");
EndpointReferenceTests.cs (20)
16var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 34var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 53var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 68var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 87var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 106var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https"); 120var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 134var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", targetPort: 5000); 148var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 167var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 185var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 216var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 229var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 242var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 255var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https"); 268var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", targetPort: 5000); 281var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 293var annotation = new EndpointAnnotation(ProtocolType.Tcp, KnownNetworkIdentifiers.LocalhostNetwork, uriScheme: "http", name: "http"); 341var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "blah", name: "http"); 385var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http");
ExpressionResolverTests.cs (1)
216var endpoint = new EndpointAnnotation(System.Net.Sockets.ProtocolType.Tcp, KnownNetworkIdentifiers.DefaultAspireContainerNetwork)
323 references to EndpointAnnotation
Aspire.Hosting (86)
ApplicationModel\AllocatedEndpoint.cs (4)
50EndpointAnnotation endpoint, 78EndpointAnnotation endpoint, 93public AllocatedEndpoint(EndpointAnnotation endpoint, string address, int port, string? targetPortExpression = null) 101public EndpointAnnotation Endpoint { get; }
ApplicationModel\EndpointAnnotation.cs (3)
28/// Initializes a new instance of <see cref="EndpointAnnotation"/>. 61/// Initializes a new instance of <see cref="EndpointAnnotation"/>. 93ModelName.ValidateName(nameof(EndpointAnnotation), name);
ApplicationModel\EndpointEnvironmentInjectionFilterAnnotation.cs (2)
9internal class EndpointEnvironmentInjectionFilterAnnotation(Func<EndpointAnnotation, bool> filter) : IResourceAnnotation 11public Func<EndpointAnnotation, bool> Filter { get; } = filter;
ApplicationModel\EndpointHostHelpers.cs (1)
115/// When the endpoint's <see cref="EndpointAnnotation.TargetHost"/> is a localhost TLD
ApplicationModel\EndpointReference.cs (7)
17private EndpointAnnotation? _endpointAnnotation; 24public EndpointAnnotation EndpointAnnotation => GetEndpointAnnotation() ?? throw new InvalidOperationException(ErrorMessage ?? $"The endpoint `{EndpointName}` is not defined for the resource `{Resource.Name}`."); 153private EndpointAnnotation? GetEndpointAnnotation() 160_endpointAnnotation ??= Resource.Annotations.OfType<EndpointAnnotation>() 167var endpointAnnotation = GetEndpointAnnotation(); 201public EndpointReference(IResourceWithEndpoints owner, EndpointAnnotation endpoint, NetworkIdentifier? contextNetworkID) 217public EndpointReference(IResourceWithEndpoints owner, EndpointAnnotation endpoint): this(owner, endpoint, null)
ApplicationModel\ProjectResource.cs (3)
101internal Dictionary<EndpointAnnotation, string> KestrelEndpointAnnotationHosts { get; } = new(); 107internal EndpointAnnotation? DefaultHttpsEndpoint { get; set; } 111var endpoint = e.EndpointAnnotation;
ApplicationModel\ResolvedEndpoint.cs (1)
14public required EndpointAnnotation Endpoint { get; init; }
ApplicationModel\ResourceExtensions.cs (12)
645public static bool TryGetEndpoints(this IResource resource, [NotNullWhen(true)] out IEnumerable<EndpointAnnotation>? endpoints) 664/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 665/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 668if (TryGetAnnotationsOfType<EndpointAnnotation>(resource, out var endpoints)) 679/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 681/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 684if (TryGetAnnotationsOfType<EndpointAnnotation>(resource, out var endpoints)) 695/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 700var endpoint = resource.TryGetEndpoints(out var endpoints) ? 716/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 723var endpoint = resource.TryGetEndpoints(out var endpoints) ? 755foreach (var endpoint in endpoints)
Backchannel\AppHostRpcTarget.cs (1)
109endpoints = Enumerable.Empty<EndpointAnnotation>();
BuiltInDistributedApplicationEventSubscriptionHandlers.cs (2)
61var httpEndpoints = resource.Annotations.OfType<EndpointAnnotation>().Where(sb => sb.UriScheme == "http" || sb.UriScheme == "https"); 62foreach (var httpEndpoint in httpEndpoints)
Dashboard\DashboardEventHandlers.cs (4)
357var endpointAnnotations = dashboardResource.Annotations.OfType<EndpointAnnotation>().ToList(); 358foreach (var endpointAnnotation in endpointAnnotations) 718.OfType<EndpointAnnotation>() 722foreach (var endpoint in allResourceEndpoints)
Dcp\AppResource.cs (2)
67public EndpointAnnotation EndpointAnnotation { get; } 78public ServiceWithModelResource(IResource modelResource, Service service, EndpointAnnotation sba) : base(modelResource, service)
Dcp\DcpExecutor.cs (14)
1104if (!TryGetEndpoint(appResource.ModelResource, ts.EndpointName, out var endpoint)) 1180.Select(r => (ModelResource: r, Endpoints: r.Annotations.OfType<EndpointAnnotation>().ToArray())) 1191foreach (var endpoint in endpoints) 1292foreach (var endpoint in re.Endpoints) 1311var hasManyEndpoints = re.Resource.Annotations.OfType<EndpointAnnotation>().Count() > 1; 2368var ea = sp.EndpointAnnotation; 2374throw new InvalidOperationException($"The endpoint '{ea.Name}' for container resource '{modelResourceName}' must specify the {nameof(EndpointAnnotation.TargetPort)} value"); 2386throw 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."); 2888var ea = sp.EndpointAnnotation; 2944private static bool TryGetEndpoint(IResource resource, string? endpointName, [NotNullWhen(true)] out EndpointAnnotation? endpoint) 2947if (resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 2957IEnumerable<EndpointAnnotation> Endpoints 2964var endpoints = resource.Annotations.OfType<EndpointAnnotation>();
Dcp\DcpNameGenerator.cs (1)
80public string GetServiceName(IResource resource, EndpointAnnotation endpoint, bool hasMultipleEndpoints, HashSet<string> allServiceNames)
Dcp\OtlpEndpointReferenceGatherer.cs (2)
56var grpcEndpoint = dashboardEndpoints.FirstOrDefault(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 57var httpEndpoint = dashboardEndpoints.FirstOrDefault(e => e.Name == KnownEndpointNames.OtlpHttpEndpointName);
Devcontainers\DevcontainerPortForwardingLifecycleHook.cs (2)
33foreach (var endpoint in @event.Resource.Annotations.OfType<EndpointAnnotation>())
Orchestrator\ApplicationOrchestrator.cs (2)
217EndpointAnnotation? primaryLaunchProfileEndpoint = null; 224foreach (var endpoint in endpoints)
ProjectResourceBuilderExtensions.cs (10)
53/// to build the equivalent <see cref="EndpointAnnotation"/>. 498var adjustTransport = (EndpointAnnotation e, string? bindingLevelProtocols = null) => 607foreach (var endpoint in endpoints) 667EndpointAnnotation GetOrCreateEndpointForScheme(string scheme) 669EndpointAnnotation? GetEndpoint(string scheme) => 670projectResource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(sb => sb.UriScheme == scheme || string.Equals(sb.Name, scheme, StringComparisons.EndpointAnnotationName)); 672var endpoint = GetEndpoint(scheme); 696var httpEndpoint = GetOrCreateEndpointForScheme("http"); 697var httpsEndpoint = GetOrCreateEndpointForScheme("https"); 785this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter)
Publishing\ManifestPublishingContext.cs (3)
481/// <see cref="EndpointAnnotation"/> entries in the <see cref="IResource.Annotations"/> 484/// <param name="resource">The <see cref="IResource"/> that contains <see cref="EndpointAnnotation"/> annotations.</param> 494var endpoint = resolved.Endpoint;
ResourceBuilderExtensions.cs (10)
857/// The <see cref="WithEndpoint{T}(IResourceBuilder{T}, string, Action{EndpointAnnotation}, bool)"/> method allows 859/// other values to compatible/consistent values. For example setting the <see cref="EndpointAnnotation.Protocol"/> property 860/// of the endpoint annotation in the callback will not automatically change the <see cref="EndpointAnnotation.UriScheme"/>. 878public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string endpointName, Action<EndpointAnnotation> callback, bool createIfNotExists = true) where T : IResourceWithEndpoints 884var endpoint = builder.Resource.Annotations 885.OfType<EndpointAnnotation>() 938var annotation = new EndpointAnnotation( 948if (builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(sb => string.Equals(sb.Name, annotation.Name, StringComparisons.EndpointAnnotationName))) 1042if (!builder.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 1047foreach (var endpoint in endpoints)
Aspire.Hosting.Azure.AppContainers (2)
ContainerAppContext.cs (2)
228var endpoint = resolved.Endpoint; 267var endpoint = resolved.Endpoint;
Aspire.Hosting.Azure.AppService (1)
AzureAppServiceWebsiteContext.cs (1)
124var endpoint = resolved.Endpoint;
Aspire.Hosting.Azure.Kusto.Tests (4)
AddAzureKustoTests.cs (4)
67var endpointAnnotations = resourceBuilder.Resource.Annotations.OfType<EndpointAnnotation>().ToList(); 68var httpEndpoint = endpointAnnotations.SingleOrDefault(e => e.Name == "http"); 358var endpointAnnotations = resourceBuilder.Resource.Annotations.OfType<EndpointAnnotation>().ToList(); 359var httpEndpoint = endpointAnnotations.SingleOrDefault(e => e.Name == "http");
Aspire.Hosting.Azure.Tests (35)
AzureCosmosDBExtensionsTests.cs (10)
36var endpointAnnotation = cosmos.Resource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(); 737var emulatorEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulator"); 769var emulatorEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulator"); 798var dataExplorerEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 828var dataExplorerEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer");
AzureEventHubsExtensionsTests.cs (1)
242var endpoints = eventHubs.Resource.Annotations.OfType<EndpointAnnotation>().ToList();
AzureFunctionsTests.cs (14)
52Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 80Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 103Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 117Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 131Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 215Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 259Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation));
AzureManagedRedisExtensionsTests.cs (2)
87var endpoint = Assert.Single(redisResource.Annotations.OfType<EndpointAnnotation>());
AzurePostgresExtensionsTests.cs (2)
182var endpoint = Assert.Single(innerPostgres.Resource.Annotations.OfType<EndpointAnnotation>());
AzureRedisExtensionsTests.cs (2)
131var endpoint = Assert.Single(redisResource.Annotations.OfType<EndpointAnnotation>());
AzureServiceBusExtensionsTests.cs (1)
165serviceBus.Resource.Annotations.OfType<EndpointAnnotation>(),
AzureSqlExtensionsTests.cs (2)
149var endpoint = Assert.Single(innerSql.Resource.Annotations.OfType<EndpointAnnotation>());
AzureStorageExtensionsTests.cs (1)
133storage.Resource.Annotations.OfType<EndpointAnnotation>(),
Aspire.Hosting.DevTunnels (2)
DevTunnelResource.cs (1)
84internal EndpointAnnotation TunnelEndpointAnnotation { get; }
DevTunnelResourceBuilderExtensions.cs (1)
527if (targetEndpoint.Resource.Annotations.OfType<EndpointAnnotation>()
Aspire.Hosting.Docker (1)
DockerComposeEnvironmentContext.cs (1)
45var endpoint = resolved.Endpoint;
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.JavaScript.Tests (2)
ResourceCreationTests.cs (2)
62Assert.True(resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)); 82Assert.True(resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints));
Aspire.Hosting.Kafka.Tests (5)
AddKafkaTests.cs (5)
29var endpoints = containerResource.Annotations.OfType<EndpointAnnotation>(); 32var primaryEndpoint = Assert.Single(endpoints, e => e.Name == "tcp"); 41var internalEndpoint = Assert.Single(endpoints, e => e.Name == "internal"); 177var kafkaUiEndpoint = kafkaUiResource.Annotations.OfType<EndpointAnnotation>().Single();
Aspire.Hosting.Keycloak.Tests (4)
KeycloakResourceBuilderTests.cs (4)
30var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == defaultEndpointName); 41var healthEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == managementEndpointName);
Aspire.Hosting.Kubernetes (2)
KubernetesResource.cs (2)
170var endpoint = resolved.Endpoint; 203private void GenerateDefaultProjectEndpointMapping(EndpointAnnotation endpoint)
Aspire.Hosting.Maui (2)
MauiOtlpExtensions.cs (2)
120var endpoint = stubResource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault();
Aspire.Hosting.Maui.Tests (2)
MauiPlatformExtensionsTests.cs (2)
635var endpointAnnotations = appBuilder.Resources.SelectMany(x => x.Annotations.OfType<EndpointAnnotation>()); 637foreach (var endpointAnnotation in endpointAnnotations)
Aspire.Hosting.Milvus.Tests (7)
AddMilvusTests.cs (7)
35var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 65var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 193Assert.Single(milvusResource.Annotations.OfType<EndpointAnnotation>()); 195var grpcEndpoint = milvusResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc");
Aspire.Hosting.MongoDB.Tests (6)
AddMongoDBTests.cs (6)
44var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 72var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 154var 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)
104var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 150var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Oracle.Tests (6)
AddOracleTests.cs (6)
52var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 91var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 173var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.PostgreSQL.Tests (14)
AddPostgresTests.cs (10)
62var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 116var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 209var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 425var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 654var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
PostgresMcpBuilderTests.cs (4)
32var endpoint = Assert.Single(mcpContainer.Annotations.OfType<EndpointAnnotation>()); 59var mcpEndpoint = Assert.Single(mcpContainer.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Qdrant.Tests (11)
AddQdrantTests.cs (11)
55var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 94var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 127var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 296Assert.Equal(2, qdrantResource.Annotations.OfType<EndpointAnnotation>().Count()); 298var grpcEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc"); 306var httpEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "http");
Aspire.Hosting.RabbitMQ.Tests (4)
AddRabbitMQTests.cs (4)
55var primaryEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "tcp"); 66var mangementEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "management");
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
252var secondaryEndpoint = endpoints.FirstOrDefault(ep => StringComparer.OrdinalIgnoreCase.Equals(ep.Name, RedisResource.SecondaryEndpointName));
Aspire.Hosting.Redis.Tests (10)
AddRedisTests.cs (10)
40var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 68var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 431var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 445var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 457var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Seq.Tests (8)
AddSeqTests.cs (8)
26var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 54var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 180var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 213var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.SqlServer.Tests (4)
AddSqlServerTests.cs (4)
48var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 260var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Tests (82)
ApplicationModel\Docker\WithDockerfileBuilderTests.cs (2)
473var endpointAnnotation = container.Resource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault();
ApplicationModel\McpServerEndpointAnnotationTests.cs (8)
73var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 88var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 103var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 119var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 135var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 150var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 165var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 182var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https");
AsHttp2ServiceTests.cs (6)
20r => r.Annotations.OfType<EndpointAnnotation>() 37var httpEndpoints = testProgram.ServiceABuilder.Resource.Annotations.OfType<EndpointAnnotation>().Where(sb => sb.UriScheme == "http" || sb.UriScheme == "https"); 52var endpoints = testProgram.ServiceABuilder.Resource.Annotations.OfType<EndpointAnnotation>(); 53var tcpBinding = endpoints.Single(sb => sb.UriScheme == "tcp"); 56var httpsBinding = endpoints.Single(sb => sb.UriScheme == "https"); 59var httpBinding = endpoints.Single(sb => sb.UriScheme == "http");
Dashboard\DashboardLifecycleHookTests.cs (2)
242var endpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == expectedScheme);
Dashboard\DashboardResourceTests.cs (4)
411var endpointAnnotation = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 694foreach (var endpoint in dashboard.Annotations.OfType<EndpointAnnotation>())
Dcp\DcpExecutorTests.cs (1)
2277var endpoint = resource.GetEndpoint(name).EndpointAnnotation;
EndpointReferenceTests.cs (20)
16var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 34var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 53var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 68var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 87var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 106var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https"); 120var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 134var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", targetPort: 5000); 148var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 167var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 185var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 216var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 229var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 242var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 255var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https"); 268var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", targetPort: 5000); 281var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 293var annotation = new EndpointAnnotation(ProtocolType.Tcp, KnownNetworkIdentifiers.LocalhostNetwork, uriScheme: "http", name: "http"); 341var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "blah", name: "http"); 385var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http");
ExpressionResolverTests.cs (3)
216var endpoint = new EndpointAnnotation(System.Net.Sockets.ProtocolType.Tcp, KnownNetworkIdentifiers.DefaultAspireContainerNetwork) 270var endpointAnnotation = dependency.Resource.Annotations.OfType<EndpointAnnotation>().Single();
KestrelConfigTests.cs (6)
25resource.Annotations.OfType<EndpointAnnotation>(), 62resource.Annotations.OfType<EndpointAnnotation>(), 94resource.Annotations.OfType<EndpointAnnotation>(), 111resource.Annotations.OfType<EndpointAnnotation>(), 455foreach (var endpoint in resource.Annotations.OfType<EndpointAnnotation>())
ProjectResourceTests.cs (1)
306resource.Annotations.OfType<EndpointAnnotation>(),
PublishAsDockerfileTests.cs (6)
282Assert.Empty(container.Annotations.OfType<EndpointAnnotation>()); 299var endpoint = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 323var endpoint = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 343var endpoints = container.Annotations.OfType<EndpointAnnotation>().OrderBy(e => e.Name).ToList();
SlimTestProgramTests.cs (4)
59var endpoint = projectBuilders.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 78var endpoint = projectBuilders.Resource.Annotations.OfType<EndpointAnnotation>().Single();
WithEndpointTests.cs (16)
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(); 586var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 622EndpointAnnotation endpoint = Assert.Single(projectA.Resource.Annotations.OfType<EndpointAnnotation>()); 656EndpointAnnotation endpoint = Assert.Single(projectA.Resource.Annotations.OfType<EndpointAnnotation>());
WithHttpCommandTests.cs (2)
551var endpointAnnotation = service.Resource.Annotations.OfType<EndpointAnnotation>().Single();
WithUrlsTests.cs (1)
559foreach (var endpoint in endpoints)
Aspire.Hosting.Valkey.Tests (4)
AddValkeyTests.cs (4)
27var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 55var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Yarp.Tests (4)
AddYarpTests.cs (4)
27Assert.Collection(resource.Annotations.OfType<EndpointAnnotation>(), 423var httpsEndpoint = Assert.Single(yarp.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "https"); 448Assert.DoesNotContain(yarp.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "https");
TestProject.AppHost (2)
TestProgram.cs (2)
181foreach (var endpoint in project.Annotations.OfType<EndpointAnnotation>())