45 instantiations of EndpointAnnotation
Aspire.Hosting (6)
Dashboard\DashboardEventHandlers.cs (4)
417dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: address.Scheme, port: address.Port, isProxied: true) 426dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: address.Scheme, port: address.Port, isProxied: true, transport: "http2") 435dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpHttpEndpointName, uriScheme: address.Scheme, port: address.Port, isProxied: true) 445dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: McpEndpointName, uriScheme: address.Scheme, port: address.Port, isProxied: true)
ResourceBuilderExtensions.cs (2)
1060endpoint = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, networkID: KnownNetworkIdentifiers.LocalhostNetwork); 1098var 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 (36)
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");
ConditionalReferenceExpressionTests.cs (5)
77var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 126var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp"); 140var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "tcp") 157var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp"); 170var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp");
Dcp\DcpHostNotificationTests.cs (2)
490resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https")); 497resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"));
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)
337 references to EndpointAnnotation
Aspire.Hosting (90)
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)
29/// Initializes a new instance of <see cref="EndpointAnnotation"/>. 62/// Initializes a new instance of <see cref="EndpointAnnotation"/>. 94ModelName.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 (9)
17private EndpointAnnotation? _endpointAnnotation; 24public EndpointAnnotation EndpointAnnotation => GetEndpointAnnotation() ?? throw new InvalidOperationException(ErrorMessage ?? $"The endpoint `{EndpointName}` is not defined for the resource `{Resource.Name}`."); 68/// Once the annotation exists, this property delegates to <see cref="EndpointAnnotation.TlsEnabled"/>. 129/// <see cref="EndpointAnnotation.TlsEnabled"/> is <see langword="true"/> on this endpoint, or to 185private EndpointAnnotation? GetEndpointAnnotation() 192_endpointAnnotation ??= Resource.Annotations.OfType<EndpointAnnotation>() 199var endpointAnnotation = GetEndpointAnnotation(); 233public EndpointReference(IResourceWithEndpoints owner, EndpointAnnotation endpoint, NetworkIdentifier? contextNetworkID) 249public 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)
669public static bool TryGetEndpoints(this IResource resource, [NotNullWhen(true)] out IEnumerable<EndpointAnnotation>? endpoints) 688/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 689/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 692if (TryGetAnnotationsOfType<EndpointAnnotation>(resource, out var endpoints)) 703/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 705/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 708if (TryGetAnnotationsOfType<EndpointAnnotation>(resource, out var endpoints)) 719/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 724var endpoint = resource.TryGetEndpoints(out var endpoints) ? 740/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 747var endpoint = resource.TryGetEndpoints(out var endpoints) ? 779foreach (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 (5)
358var endpointAnnotations = dashboardResource.Annotations.OfType<EndpointAnnotation>().ToList(); 359foreach (var endpointAnnotation in endpointAnnotations) 452var hasHttpsEndpoint = dashboardResource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints) && endpoints.Any(e => e.UriScheme is "https"); 755.OfType<EndpointAnnotation>() 759foreach (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)
1109if (!TryGetEndpoint(appResource.ModelResource, ts.EndpointName, out var endpoint)) 1185.Select(r => (ModelResource: r, Endpoints: r.Annotations.OfType<EndpointAnnotation>().ToArray())) 1196foreach (var endpoint in endpoints) 1297foreach (var endpoint in re.Endpoints) 1316var hasManyEndpoints = re.Resource.Annotations.OfType<EndpointAnnotation>().Count() > 1; 2458var ea = sp.EndpointAnnotation; 2464throw new InvalidOperationException($"The endpoint '{ea.Name}' for container resource '{modelResourceName}' must specify the {nameof(EndpointAnnotation.TargetPort)} value"); 2476throw 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."); 2978var ea = sp.EndpointAnnotation; 3034private static bool TryGetEndpoint(IResource resource, string? endpointName, [NotNullWhen(true)] out EndpointAnnotation? endpoint) 3037if (resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 3047IEnumerable<EndpointAnnotation> Endpoints 3054var endpoints = resource.Annotations.OfType<EndpointAnnotation>();
Dcp\DcpHost.cs (1)
555if (resource.Annotations.OfType<EndpointAnnotation>().Any(e => e.UriScheme is "https"))
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"/>. 515var adjustTransport = (EndpointAnnotation e, string? bindingLevelProtocols = null) => 624foreach (var endpoint in endpoints) 684EndpointAnnotation GetOrCreateEndpointForScheme(string scheme) 686EndpointAnnotation? GetEndpoint(string scheme) => 687projectResource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(sb => sb.UriScheme == scheme || string.Equals(sb.Name, scheme, StringComparisons.EndpointAnnotationName)); 689var endpoint = GetEndpoint(scheme); 713var httpEndpoint = GetOrCreateEndpointForScheme("http"); 714var httpsEndpoint = GetOrCreateEndpointForScheme("https"); 805this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter)
Publishing\ManifestPublishingContext.cs (3)
484/// <see cref="EndpointAnnotation"/> entries in the <see cref="IResource.Annotations"/> 487/// <param name="resource">The <see cref="IResource"/> that contains <see cref="EndpointAnnotation"/> annotations.</param> 497var endpoint = resolved.Endpoint;
ResourceBuilderExtensions.cs (10)
1016/// The <see cref="WithEndpoint{T}(IResourceBuilder{T}, string, Action{EndpointAnnotation}, bool)"/> method allows 1018/// other values to compatible/consistent values. For example setting the <see cref="EndpointAnnotation.Protocol"/> property 1019/// of the endpoint annotation in the callback will not automatically change the <see cref="EndpointAnnotation.UriScheme"/>. 1039public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string endpointName, Action<EndpointAnnotation> callback, bool createIfNotExists = true) where T : IResourceWithEndpoints 1045var endpoint = builder.Resource.Annotations 1046.OfType<EndpointAnnotation>() 1098var annotation = new EndpointAnnotation( 1108if (builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(sb => string.Equals(sb.Name, annotation.Name, StringComparisons.EndpointAnnotationName))) 1204if (!builder.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 1209foreach (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)
60Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 88Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 111Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 125Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 139Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 223Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 267Assert.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)
543if (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 (2)
JavaScriptHostingExtensions.cs (2)
1055EndpointAnnotation? endpointAnnotation = null; 1056if (parentResource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints))
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)
172var endpoint = resolved.Endpoint; 205private void GenerateDefaultProjectEndpointMapping(EndpointAnnotation endpoint)
Aspire.Hosting.Maui (2)
MauiOtlpExtensions.cs (2)
121var 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)
63var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 117var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 233var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 449var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 678var 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)
62var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 101var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 134var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 331Assert.Equal(2, qdrantResource.Annotations.OfType<EndpointAnnotation>().Count()); 333var grpcEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc"); 341var 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 (2)
RedisBuilderExtensions.cs (1)
252var secondaryEndpoint = endpoints.FirstOrDefault(ep => string.Equals(ep.Name, RedisResource.SecondaryEndpointName, StringComparisons.EndpointAnnotationName));
RedisResource.cs (1)
70/// This property proxies through to <see cref="EndpointAnnotation.TlsEnabled"/> on the
Aspire.Hosting.Redis.Tests (12)
AddRedisTests.cs (12)
42var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 70var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 405var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 419var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 431var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 828var endpoint = Assert.Single(redis.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "tcp");
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 (87)
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");
ConditionalReferenceExpressionTests.cs (5)
77var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 126var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp"); 140var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "tcp") 157var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp"); 170var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp");
Dashboard\DashboardLifecycleHookTests.cs (2)
244var endpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == expectedScheme);
Dashboard\DashboardResourceTests.cs (4)
418var endpointAnnotation = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 728foreach (var endpoint in dashboard.Annotations.OfType<EndpointAnnotation>())
Dcp\DcpExecutorTests.cs (1)
2310var 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)
184foreach (var endpoint in project.Annotations.OfType<EndpointAnnotation>())