77 instantiations of EndpointAnnotation
Aspire.Hosting (6)
Dashboard\DashboardEventHandlers.cs (4)
223dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: endpointContext.Scheme, isProxied: true)); 242dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: address.Scheme, port: address.Port, isProxied: true) 621annotation = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: context.Scheme, isProxied: true, transport: transport) 630annotation = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: address.Scheme, port: address.Port, isProxied: true, transport: transport)
ResourceBuilderExtensions.cs (2)
1544endpoint = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, networkId: KnownNetworkIdentifiers.LocalhostNetwork); 1666var 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)
76TunnelEndpointAnnotation = new EndpointAnnotation(
Aspire.Hosting.Maui (1)
Otlp\OtlpLoopbackResource.cs (1)
31OtlpEndpoint = new EndpointAnnotation(
Aspire.Hosting.Maui.Tests (9)
MauiPlatformExtensionsTests.cs (9)
754dashboard.Resource.Annotations.Add(new EndpointAnnotation( 807dashboard.Resource.Annotations.Add(new EndpointAnnotation( 813dashboard.Resource.Annotations.Add(new EndpointAnnotation( 871var dashboardEndpoint = new EndpointAnnotation( 910dashboard.Resource.Annotations.Add(new EndpointAnnotation( 967var dashboardEndpoint = new EndpointAnnotation( 1193dashboard.Resource.Annotations.Add(new EndpointAnnotation( 1275dashboard.Resource.Annotations.Add(new EndpointAnnotation( 1311dashboard.Resource.Annotations.Add(new EndpointAnnotation(
Aspire.Hosting.Radius.Tests (7)
Publishing\RadiusServiceDiscoveryTests.cs (7)
26resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", port: 5000, targetPort: 8080)); 37resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", port: 5000)); 48resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http")); 59resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https")); 70var https = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https"); 83resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "tcp", name: "one")); 84resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "tcp", name: "two"));
Aspire.Hosting.Testing.Tests (1)
TestingPublicApiTests.cs (1)
488var endpoint = new EndpointAnnotation(System.Net.Sockets.ProtocolType.Tcp, uriScheme: endpointName, name: endpointName);
Aspire.Hosting.Tests (51)
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");
ComputeEnvironmentEndpointResolverTests.cs (1)
151var endpoint = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", port: port, targetPort: targetPort);
ComputeEnvironmentValidationTests.cs (1)
100var endpoint = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: uriScheme, name: uriScheme, port: port, targetPort: targetPort);
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)
788resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https")); 795resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"));
Dcp\ProxylessEndpointPortAllocatorTests.cs (1)
99return new EndpointAnnotation(ProtocolType.Tcp, name: name, isProxied: false);
EndpointReferenceTests.cs (24)
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"); 415var httpEndpoint = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "http"); 431resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http")); 432resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "tcp", name: "grpc")); 459resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"));
ExpressionResolverTests.cs (2)
191var nonHostEndpoint = new EndpointAnnotation( 253var endpoint = new EndpointAnnotation(System.Net.Sockets.ProtocolType.Tcp, KnownNetworkIdentifiers.DefaultAspireContainerNetwork)
ResourceDependencyTests.cs (1)
75var nonHostEndpoint = new EndpointAnnotation(
WithEndpointTests.cs (1)
108var endpoint = new EndpointAnnotation(ProtocolType.Tcp);
WithOtlpExporterTests.cs (5)
158dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: "http", port: 18889, isProxied: true, transport: transport)); 195dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2")); 196dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpHttpEndpointName, uriScheme: "http", port: 18890, isProxied: true)); 250dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2")); 280dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2"));
594 references to EndpointAnnotation
Aspire.Hosting (135)
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 (5)
32/// Initializes a new instance of <see cref="EndpointAnnotation"/>. 65/// Initializes a new instance of <see cref="EndpointAnnotation"/>. 98/// Initializes a new instance of <see cref="EndpointAnnotation"/>. 130ModelName.ValidateName(nameof(EndpointAnnotation), name); 147/// Initializes a new instance of <see cref="EndpointAnnotation"/>.
ApplicationModel\EndpointEnvironmentInjectionFilterAnnotation.cs (2)
9internal class EndpointEnvironmentInjectionFilterAnnotation(Func<EndpointAnnotation, bool> filter) : IResourceAnnotation 11public Func<EndpointAnnotation, bool> Filter { get; } = filter;
ApplicationModel\EndpointHostHelpers.cs (1)
116/// When the endpoint's <see cref="EndpointAnnotation.TargetHost"/> is a localhost TLD
ApplicationModel\EndpointReference.cs (11)
17private EndpointAnnotation? _endpointAnnotation; 24public EndpointAnnotation EndpointAnnotation => GetEndpointAnnotation() ?? throw new InvalidOperationException(ErrorMessage ?? BuildMissingEndpointMessage()); 29.OfType<EndpointAnnotation>() 86/// Once the annotation exists, this property delegates to <see cref="EndpointAnnotation.TlsEnabled"/>. 104/// Once the annotation exists, this property delegates to <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/>. 167/// <see cref="EndpointAnnotation.TlsEnabled"/> is <see langword="true"/> on this endpoint, or to 224private EndpointAnnotation? GetEndpointAnnotation() 231_endpointAnnotation ??= Resource.Annotations.OfType<EndpointAnnotation>() 239var endpointAnnotation = GetEndpointAnnotation(); 262public EndpointReference(IResourceWithEndpoints owner, EndpointAnnotation endpoint, NetworkIdentifier? contextNetworkId) 278public EndpointReference(IResourceWithEndpoints owner, EndpointAnnotation endpoint): this(owner, endpoint, null)
ApplicationModel\EndpointUpdateContext.cs (2)
12internal sealed class EndpointUpdateContext(EndpointAnnotation endpointAnnotation) 14private readonly EndpointAnnotation _endpointAnnotation = endpointAnnotation ?? throw new ArgumentNullException(nameof(endpointAnnotation));
ApplicationModel\HostUrl.cs (3)
70if (r.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(ep => MatchesHostPort(ep, uri.Port)) is EndpointAnnotation ep) 150internal static bool MatchesHostPort(EndpointAnnotation endpoint, int port)
ApplicationModel\IComputeEnvironmentResource.cs (2)
46var endpoint = endpointReference.EndpointAnnotation; 68private static int GetDefaultPort(string scheme, EndpointAnnotation endpoint)
ApplicationModel\ProjectLaunchDefaultsAnnotation.cs (3)
24internal Dictionary<EndpointAnnotation, string> KestrelEndpointAnnotationHosts { get; } = []; 30public EndpointAnnotation? DefaultHttpsEndpoint { get; internal set; } 80var endpoint = e.EndpointAnnotation;
ApplicationModel\ResolvedEndpoint.cs (1)
14public required EndpointAnnotation Endpoint { get; init; }
ApplicationModel\ResourceExtensions.cs (15)
734public static bool TryGetEndpoints(this IResource resource, [NotNullWhen(true)] out IEnumerable<EndpointAnnotation>? endpoints) 754/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 755/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 759if (TryGetAnnotationsOfType<EndpointAnnotation>(resource, out var endpoints)) 770/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 772/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 776if (TryGetAnnotationsOfType<EndpointAnnotation>(resource, out var endpoints)) 787/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 793var endpoint = resource.TryGetEndpoints(out var endpoints) ? 809/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 817var endpoint = resource.TryGetEndpoints(out var endpoints) ? 850foreach (var endpoint in endpoints) 852var publicPort = EndpointAnnotation.NormalizePort(endpoint.Port); 853var configuredTargetPort = EndpointAnnotation.NormalizePort(endpoint.TargetPort); 1903if (resource.Annotations.OfType<EndpointAnnotation>().Any(ep => HostUrl.MatchesHostPort(ep, port)) && dependencies.Add(resource))
Backchannel\AppHostRpcTarget.cs (1)
136endpoints = 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 (6)
202var endpointAnnotations = dashboardResource.Annotations.OfType<EndpointAnnotation>().ToList(); 203foreach (var endpointAnnotation in endpointAnnotations) 268var hasHttpsEndpoint = dashboardResource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints) && endpoints.Any(e => e.UriScheme is "https"); 617EndpointAnnotation annotation; 713.OfType<EndpointAnnotation>() 717foreach (var endpoint in allResourceEndpoints)
Dcp\AppResource.cs (2)
85public EndpointAnnotation EndpointAnnotation { get; } 96public ServiceWithModelResource(IResource modelResource, Service service, EndpointAnnotation sba) : base(modelResource, service)
Dcp\ContainerCreator.cs (1)
709var ea = sp.EndpointAnnotation;
Dcp\ContainerNetworkEndpointProvisioner.cs (7)
23IEnumerable<EndpointAnnotation> Endpoints) 29var endpoints = resource.Annotations.OfType<EndpointAnnotation>().ToArray(); 69private readonly Dictionary<EndpointAnnotation, TaskCompletionSource> _endpointProvisioning = new(ReferenceEqualityComparer.Instance); 99internal bool CanProvisionEndpoint(EndpointAnnotation endpoint) 173foreach (var endpoint in hostResource.Endpoints) 238var newEndpointsByResource = new Dictionary<IResourceWithEndpoints, List<EndpointAnnotation>>(ReferenceEqualityComparer.Instance); 247foreach (var endpoint in hostResource.Endpoints)
Dcp\DcpExecutor.cs (13)
639.Select(r => (ModelResource: r, Endpoints: r.Annotations.OfType<EndpointAnnotation>().ToArray())) 646foreach (var endpoint in sp.Endpoints) 663EndpointAnnotation.NormalizePort(endpoint.TargetPort) is int fixedTargetPort) 675foreach (var endpoint in endpoints) 739private static bool GetEffectiveIsProxied(IResource resource, EndpointAnnotation endpoint, bool randomizePorts) 776var endpoint = serviceProducer.EndpointAnnotation; 778EndpointAnnotation.NormalizePort(endpoint.TargetPort) is not null) 815private static bool TryGetEffectiveFixedPublicPort(IResource resource, EndpointAnnotation endpoint, bool randomizePorts, out int publicPort) 817var effectivePublicPort = EndpointAnnotation.NormalizePort(resource.IsContainer() ? endpoint.SpecifiedPort : endpoint.Port); 837private void EnsureProxylessEndpointPort(IResource resource, EndpointAnnotation endpoint) 872private static bool NeedsPublicPort(IResource resource, EndpointAnnotation endpoint) 881private int? TryGetPersistedProxylessEndpointPort(IResource resource, EndpointAnnotation endpoint) 906private static string GetPersistedProxylessEndpointPortKey(IResource resource, EndpointAnnotation endpoint)
Dcp\DcpHost.cs (1)
756if (resource.Annotations.OfType<EndpointAnnotation>().Any(e => e.UriScheme is "https"))
Dcp\DcpModelUtilities.cs (9)
31internal static void ValidateEndpointPorts(IResource modelResource, EndpointAnnotation endpoint) 37if (EndpointAnnotation.NormalizePort(endpoint.TargetPort) is null) 39throw new InvalidOperationException($"The endpoint '{endpoint.Name}' for container resource '{modelResourceName}' must specify the {nameof(EndpointAnnotation.TargetPort)} value"); 44throw new InvalidOperationException($"The endpoint '{endpoint.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."); 62var ea = sp.EndpointAnnotation; 303if (!TryGetEndpoint(res, ts.EndpointName, out var endpoint)) 341private static bool TryGetEndpoint(IResource resource, string? endpointName, [NotNullWhen(true)] out EndpointAnnotation? endpoint) 344if (resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints))
Dcp\DcpNameGenerator.cs (3)
113public (string, bool) GetServiceName(IResource resource, EndpointAnnotation endpoint, NetworkIdentifier targetNetworkId) 115var hasMultipleEndpoints = resource.Annotations.OfType<EndpointAnnotation>().Count() > 1; 190private static string NetworkServiceKey(IResource resource, EndpointAnnotation endpoint, NetworkIdentifier targetNetworkId)
Dcp\ExecutableCreator.cs (2)
131var endpointsByResource = new Dictionary<IResourceWithEndpoints, HashSet<EndpointAnnotation>>(ReferenceEqualityComparer.Instance); 163endpoints = new HashSet<EndpointAnnotation>(ReferenceEqualityComparer.Instance);
Dcp\ProxylessEndpointPortAllocator.cs (2)
37private readonly Dictionary<EndpointAnnotation, int> _reservedPorts = new(ReferenceEqualityComparer.Instance); 86public int AllocatePort(EndpointAnnotation endpoint)
Devcontainers\DevcontainerPortForwardingEventingSubscriber.cs (2)
33foreach (var endpoint in @event.Resource.Annotations.OfType<EndpointAnnotation>())
DotnetProgramResourceBuilderExtensions.cs (1)
57Func<EndpointAnnotation, bool> filter)
Orchestrator\ApplicationOrchestrator.cs (2)
304EndpointAnnotation? primaryLaunchProfileEndpoint = null; 311foreach (var endpoint in endpoints)
ProjectResourceBuilderExtensions.cs (11)
53/// to build the equivalent <see cref="EndpointAnnotation"/>. 595if (!ctx.Resource.Annotations.OfType<EndpointAnnotation>().Any(e => e.TlsEnabled)) 684var adjustTransport = (EndpointAnnotation e, string? bindingLevelProtocols = null) => 793foreach (var endpoint in endpoints) 853EndpointAnnotation GetOrCreateEndpointForScheme(string scheme) 855EndpointAnnotation? GetEndpoint(string scheme) => 856projectResource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(sb => sb.UriScheme == scheme || string.Equals(sb.Name, scheme, StringComparisons.EndpointAnnotationName)); 858var endpoint = GetEndpoint(scheme); 882var httpEndpoint = GetOrCreateEndpointForScheme("http"); 883var httpsEndpoint = GetOrCreateEndpointForScheme("https"); 978this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter)
Publishing\ManifestPublishingContext.cs (3)
493/// <see cref="EndpointAnnotation"/> entries in the <see cref="IResource.Annotations"/> 496/// <param name="resource">The <see cref="IResource"/> that contains <see cref="EndpointAnnotation"/> annotations.</param> 506var endpoint = resolved.Endpoint;
ResourceBuilderExtensions.cs (18)
1246/// Each non-excluded endpoint (where <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> is <c>false</c>) defined on the source resource will be injected using the format defined by 1257/// Resource authors can opt out individual endpoints by setting <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> to <c>true</c> 1277/// Each non-excluded endpoint (where <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> is <c>false</c>) defined on the source resource will be injected using the format defined by 1289/// Resource authors can opt out individual endpoints by setting <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> to <c>true</c> 1500/// The <see cref="WithEndpoint{T}(IResourceBuilder{T}, string, Action{EndpointAnnotation}, bool)"/> method allows 1502/// other values to compatible/consistent values. For example setting the <see cref="EndpointAnnotation.Protocol"/> property 1503/// of the endpoint annotation in the callback will not automatically change the <see cref="EndpointAnnotation.UriScheme"/>. 1523public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string endpointName, Action<EndpointAnnotation> callback, bool createIfNotExists = true) where T : IResourceWithEndpoints 1529var endpoint = builder.Resource.Annotations 1530.OfType<EndpointAnnotation>() 1596!builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(endpoint => string.Equals(endpoint.Name, endpointName, StringComparisons.EndpointAnnotationName))) 1633var existing = builder.Resource.Annotations.OfType<EndpointAnnotation>() 1666var annotation = new EndpointAnnotation( 1709/// <see cref="EndpointAnnotation.TargetPortEnvironmentVariable"/> is updated 1712private static void ConfigureEndpointEnvironmentVariable<T>(IResourceBuilder<T> builder, EndpointAnnotation endpointAnnotation, string? env) where T : IResourceWithEndpoints 1924if (!builder.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 1929foreach (var endpoint in endpoints)
Aspire.Hosting.Azure.AppContainers (3)
AzureContainerAppEnvironmentResource.cs (1)
397var endpoint = endpointReference.EndpointAnnotation;
ContainerAppContext.cs (2)
233var endpoint = resolved.Endpoint; 273var endpoint = resolved.Endpoint;
Aspire.Hosting.Azure.AppService (2)
AzureAppServiceEnvironmentResource.cs (1)
524var endpoint = endpointReference.EndpointAnnotation;
AzureAppServiceWebsiteContext.cs (1)
160var endpoint = resolved.Endpoint;
Aspire.Hosting.Azure.Kusto.Tests (4)
AddAzureKustoTests.cs (4)
69var endpointAnnotations = resourceBuilder.Resource.Annotations.OfType<EndpointAnnotation>().ToList(); 70var httpEndpoint = endpointAnnotations.SingleOrDefault(e => e.Name == "http"); 359var endpointAnnotations = resourceBuilder.Resource.Annotations.OfType<EndpointAnnotation>().ToList(); 360var httpEndpoint = endpointAnnotations.SingleOrDefault(e => e.Name == "http");
Aspire.Hosting.Azure.Sandboxes (1)
AzureSandboxContainerDeployment.cs (1)
1577private static string ResolveSandboxPortProtocol(IResource resource, EndpointAnnotation endpoint)
Aspire.Hosting.Azure.Tests (45)
AzureCosmosDBExtensionsTests.cs (16)
38var endpointAnnotation = cosmos.Resource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(); 809var emulatorEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulator"); 841var emulatorEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulator"); 870var dataExplorerEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 900var dataExplorerEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 1013var endpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 1073var healthEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulatorhealth"); 1124var endpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer");
AzureEventHubsExtensionsTests.cs (1)
244var 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)
167serviceBus.Resource.Annotations.OfType<EndpointAnnotation>(),
AzureSqlExtensionsTests.cs (2)
149var endpoint = Assert.Single(innerSql.Resource.Annotations.OfType<EndpointAnnotation>());
AzureStorageExtensionsTests.cs (1)
133storage.Resource.Annotations.OfType<EndpointAnnotation>(),
DurableTaskResourceExtensionsTests.cs (4)
167var endpointAnnotations = dts.Resource.Annotations.OfType<EndpointAnnotation>().ToList(); 169var grpc = endpointAnnotations.SingleOrDefault(e => e.Name == "grpc"); 173var http = endpointAnnotations.SingleOrDefault(e => e.Name == "http"); 178var dashboard = endpointAnnotations.SingleOrDefault(e => e.Name == "dashboard");
Aspire.Hosting.Blazor (7)
BlazorGatewayExtensions.cs (5)
861private static List<EndpointAnnotation> GetAllocatedEndpoints(IResource resource) 863var endpoints = new List<EndpointAnnotation>(); 866if (annotation is EndpointAnnotation ep && ep.AllocatedEndpoint is not null) 875List<EndpointAnnotation> endpoints, string pathPrefix) 878foreach (var ep in endpoints)
BrowserDebuggerHelper.cs (2)
101EndpointAnnotation? endpointAnnotation = null; 102if (parentResource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints))
Aspire.Hosting.Blazor.Tests (8)
AddBlazorGatewayTests.cs (7)
52gateway.Resource.Annotations.OfType<EndpointAnnotation>().OrderBy(endpoint => endpoint.Name), 217var backendEndpoint = backend.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 223gateway.Resource.Annotations.Remove(gateway.Resource.Annotations.OfType<EndpointAnnotation>().Single(endpoint => endpoint.Name == "https")); 271var endpoint = gateway.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 272endpoint.AllocatedEndpoint = context.Resource.Annotations.OfType<EndpointAnnotation>().Single().AllocatedEndpoint;
AddDotnetProjectBlazorGatewayTests.cs (1)
29gateway.Resource.Annotations.OfType<EndpointAnnotation>().Select(e => e.Name));
Aspire.Hosting.Browsers (2)
BrowserLogsBuilderExtensions.cs (2)
321EndpointAnnotation? endpointAnnotation = null; 322if (resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints))
Aspire.Hosting.Browsers.Tests (2)
src\Aspire.Hosting.Browsers\BrowserLogsBuilderExtensions.cs (2)
321EndpointAnnotation? endpointAnnotation = null; 322if (resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints))
Aspire.Hosting.DevTunnels (2)
DevTunnelResource.cs (1)
95internal EndpointAnnotation TunnelEndpointAnnotation { get; }
DevTunnelResourceBuilderExtensions.cs (1)
581if (targetEndpoint.Resource.Annotations.OfType<EndpointAnnotation>()
Aspire.Hosting.Docker (1)
DockerComposeEnvironmentContext.cs (1)
45var endpoint = resolved.Endpoint;
Aspire.Hosting.Dotnet.Tests (7)
DotnetProjectOptionsTests.cs (3)
55var endpoint = Assert.Single(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 84var endpoints = resource.Annotations.OfType<EndpointAnnotation>();
DotnetProjectResourceTests.cs (4)
464var endpoint = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 581var endpoint = Assert.Single(app.Resource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Foundry (4)
HostedAgent\AzureHostedAgentResource.cs (1)
491var endpoint = endpointReference.EndpointAnnotation;
HostedAgent\HostedAgentBuilderExtension.cs (3)
295var existingHttpEndpoint = builder.Resource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(e => e.Name == "http"); 570targetWithEndpoints.Annotations.OfType<EndpointAnnotation>().Any(e => string.Equals(e.Name, "http", StringComparisons.EndpointAnnotationName)))
Aspire.Hosting.Foundry.Tests (7)
HostedAgentExtensionTests.cs (7)
67var httpEndpoint = endpoints.Single(e => e.Name == "http"); 170var endpoint = Assert.Single(agent.Resource.Annotations.OfType<EndpointAnnotation>()); 401var endpoint = Assert.Single(hostedAgent.Target.Annotations.OfType<EndpointAnnotation>()); 421var endpoint = Assert.Single(hostedAgent.Target.Annotations.OfType<EndpointAnnotation>());
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.Java.Tests (10)
AddJavaContainerTests.cs (1)
102Assert.Empty(app.Resource.Annotations.OfType<EndpointAnnotation>());
AddQuarkusAppTests.cs (4)
144var endpoint = Assert.Single(app.Resource.Annotations.OfType<EndpointAnnotation>()); 161var endpoint = Assert.Single(app.Resource.Annotations.OfType<EndpointAnnotation>());
AddSpringBootAppTests.cs (3)
156var endpoint = Assert.Single(app.Resource.Annotations.OfType<EndpointAnnotation>()); 365Assert.True(Assert.Single(app.Resource.Annotations.OfType<EndpointAnnotation>()).IsExternal);
TestEndpointAllocator.cs (2)
17foreach (var endpoint in resource.Annotations.OfType<EndpointAnnotation>())
Aspire.Hosting.JavaScript (7)
DenoCommandLineAnnotation.cs (1)
137public EndpointAnnotation? ServeEndpoint { get; set; }
DenoHostingExtensions.cs (4)
422var existingEndpoint = builder.Resource.Annotations 423.OfType<EndpointAnnotation>() 431var serveEndpoint = builder.Resource.Annotations 432.OfType<EndpointAnnotation>()
JavaScriptHostingExtensions.cs (2)
2954EndpointAnnotation? endpointAnnotation = null; 2955if (parentResource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints))
Aspire.Hosting.JavaScript.Tests (10)
AddDenoAppTests.cs (8)
1136Assert.Empty(denoApp.Resource.Annotations.OfType<EndpointAnnotation>()); 1160var endpoint = Assert.Single(denoApp.Resource.Annotations.OfType<EndpointAnnotation>()); 1189var endpoint = Assert.Single(denoApp.Resource.Annotations.OfType<EndpointAnnotation>()); 1205var callerEndpoint = denoApp.Resource.GetEndpoint("http").EndpointAnnotation; 1210var endpoint = Assert.Single(denoApp.Resource.Annotations.OfType<EndpointAnnotation>());
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)
90var endpoints = containerResource.Annotations.OfType<EndpointAnnotation>(); 93var primaryEndpoint = Assert.Single(endpoints, e => e.Name == "tcp"); 102var internalEndpoint = Assert.Single(endpoints, e => e.Name == "internal"); 238var kafkaUiEndpoint = kafkaUiResource.Annotations.OfType<EndpointAnnotation>().Single();
Aspire.Hosting.Keycloak.Tests (6)
KeycloakResourceBuilderTests.cs (6)
34var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == defaultEndpointName); 45var healthEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == managementEndpointName); 83var endpoints = keycloak.Resource.Annotations.OfType<EndpointAnnotation>().ToArray(); 85var primaryEndpoint = Assert.Single(endpoints, e => e.Name == "http");
Aspire.Hosting.Kubernetes (4)
Extensions\EndpointRoutingValidation.cs (2)
21/// setting <see cref="EndpointAnnotation.IsExternal"/> directly. 27/// endpoint is not marked external on its <see cref="EndpointAnnotation"/>.
KubernetesResource.cs (2)
238var endpoint = resolved.Endpoint; 281private void GenerateDefaultProjectEndpointMapping(EndpointAnnotation endpoint)
Aspire.Hosting.Maui (5)
Annotations\OtlpDevTunnelConfigurationAnnotation.cs (1)
75var endpoint = OtlpStub.OtlpEndpoint;
MauiOtlpExtensions.cs (3)
561private static string GetOtlpProtocol(EndpointAnnotation endpoint) 569EndpointAnnotation targetEndpoint, 599EndpointAnnotation endpoint,
Otlp\OtlpLoopbackResource.cs (1)
53internal EndpointAnnotation OtlpEndpoint { get; }
Aspire.Hosting.Maui.Tests (22)
MauiPlatformExtensionsTests.cs (22)
719var endpointAnnotations = appBuilder.Resources.SelectMany(x => x.Annotations.OfType<EndpointAnnotation>()); 721foreach (var endpointAnnotation in endpointAnnotations) 766var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint; 774var dashboardEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 825var httpEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>() 828var grpcEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>() 836var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint; 871var dashboardEndpoint = new EndpointAnnotation( 935var dashboardEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 946var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint; 967var dashboardEndpoint = new EndpointAnnotation( 976var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint; 1033var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint; 1167var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint; 1213var dashboardEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 1323var dashboardEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single();
Aspire.Hosting.Milvus.Tests (7)
AddMilvusTests.cs (7)
35var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 65var endpoint = containerResource.Annotations.OfType<EndpointAnnotation>() 195Assert.Single(milvusResource.Annotations.OfType<EndpointAnnotation>()); 197var grpcEndpoint = milvusResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc");
Aspire.Hosting.MongoDB (1)
MongoDBServerResource.cs (1)
102/// This property proxies through to <see cref="EndpointAnnotation.TlsEnabled"/> on the <see cref="PrimaryEndpoint"/>,
Aspire.Hosting.MongoDB.Tests (8)
AddMongoDBTests.cs (6)
49var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 77var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 159var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
SingleMemberReplicaSetTests.cs (2)
35var endpoint = Assert.Single(mongo.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>()); 471var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 700var 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>() 422Assert.Equal(2, qdrantResource.Annotations.OfType<EndpointAnnotation>().Count()); 424var grpcEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc"); 432var 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.Radius (7)
Publishing\RadiusInfrastructureBuilder.cs (5)
3439/// <see cref="EndpointAnnotation.TlsEnabled"/> set, which describes how the container runs 3498var endpoints = resource.Annotations.OfType<EndpointAnnotation>().ToList(); 3586/// Maps a compute resource's <see cref="EndpointAnnotation"/>s to Radius container ports, 3593if (!resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 3599foreach (var endpoint in endpoints)
RadiusEnvironmentResource.cs (2)
176var endpoint = endpointReference.EndpointAnnotation; 311private static int GetDefaultPort(string scheme, EndpointAnnotation endpoint)
Aspire.Hosting.Radius.Tests (1)
Publishing\RadiusServiceDiscoveryTests.cs (1)
70var https = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https");
Aspire.Hosting.Redis (2)
RedisBuilderExtensions.cs (1)
321var 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)
44var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 72var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 479var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 493var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 505var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 953var 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)
52var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 264var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Testing.Tests (2)
TestingPublicApiTests.cs (2)
486private static EndpointAnnotation CreateAllocatedEndpoint(string endpointName, int port) 488var endpoint = new EndpointAnnotation(System.Net.Sockets.ProtocolType.Tcp, uriScheme: endpointName, name: endpointName);
Aspire.Hosting.Tests (186)
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");
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (2)
2165var endpoint = dashboard.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "http");
ComputeEnvironmentEndpointResolverTests.cs (1)
151var endpoint = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", port: port, targetPort: targetPort);
ComputeEnvironmentValidationTests.cs (1)
100var endpoint = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: uriScheme, name: uriScheme, port: port, targetPort: targetPort);
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\DashboardEventHandlersTests.cs (12)
477var endpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == expectedScheme); 479var otlpGrpcEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 481var otlpHttpEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 559var httpEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "http"); 561var otlpGrpcEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 563var otlpHttpEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpHttpEndpointName);
Dashboard\DashboardResourceTests.cs (22)
222var otlpGrpcEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 223var otlpHttpEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 256var otlpGrpcEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 257var otlpHttpEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 299var otlpGrpcEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 300var otlpHttpEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 327var frontendEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name is "http" or "https"); 511var endpointAnnotation = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 515Assert.DoesNotContain(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 557var endpointAnnotation = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 561Assert.Contains(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 872foreach (var endpoint in dashboard.Annotations.OfType<EndpointAnnotation>())
Dcp\DcpExecutorTests.cs (5)
1482var computeEndpoint = compute.GetEndpoint("tcp").EndpointAnnotation; 1483var tunnelEndpoint = Assert.Single(tunnelPort.Annotations.OfType<EndpointAnnotation>()); 1524var endpoint = emulator.GetEndpoint("http").EndpointAnnotation; 9692var endpoint = resource.GetEndpoint(name).EndpointAnnotation;
Dcp\ProxylessEndpointPortAllocatorTests.cs (2)
76var endpoint = CreateEndpoint("endpoint"); 97private static EndpointAnnotation CreateEndpoint(string name)
DistributedApplicationTests.cs (1)
2357var hasMultipleEndpoints = redis.Annotations.OfType<EndpointAnnotation>().Count() > 1;
EndpointReferenceTests.cs (21)
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"); 415var httpEndpoint = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "http");
ExpressionResolverTests.cs (4)
191var nonHostEndpoint = new EndpointAnnotation( 253var endpoint = new EndpointAnnotation(System.Net.Sockets.ProtocolType.Tcp, KnownNetworkIdentifiers.DefaultAspireContainerNetwork) 307var endpointAnnotation = dependency.Resource.Annotations.OfType<EndpointAnnotation>().Single();
HealthCheckTests.cs (1)
90var endpoint = resource.GetEndpoint("http").EndpointAnnotation;
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)
327resource.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();
ResourceDependencyTests.cs (1)
75var nonHostEndpoint = new EndpointAnnotation(
SlimTestProgramTests.cs (4)
59var endpoint = projectBuilders.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 78var endpoint = projectBuilders.Resource.Annotations.OfType<EndpointAnnotation>().Single();
WithEndpointTests.cs (56)
78typeof(EndpointAnnotation), 89typeof(EndpointAnnotation), 100var isProxiedProperty = typeof(EndpointAnnotation).GetProperty(nameof(EndpointAnnotation.IsProxied), BindingFlags.Public | BindingFlags.Instance); 108var endpoint = new EndpointAnnotation(ProtocolType.Tcp); 118typeof(EndpointAnnotation), 128var endpoint = Assert.IsType<EndpointAnnotation>(constructor!.Invoke([ProtocolType.Tcp, "http", null, "http", null, null, null, true])); 142var endpoint = Assert.Single(container.Resource.Annotations.OfType<EndpointAnnotation>()); 155var endpoint = Assert.Single(container.Resource.Annotations.OfType<EndpointAnnotation>()); 172var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 211var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 246var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 284Assert.False(projectA.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var annotations)); 301Assert.True(projectA.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out _)); 318Assert.True(projectA.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out _)); 329var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>() 345var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>() 363var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "mybinding"); 378var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "https"); 392var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "mybinding"); 414var endpoints = resource.Annotations.OfType<EndpointAnnotation>().ToArray(); 782var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 818EndpointAnnotation endpoint = Assert.Single(projectA.Resource.Annotations.OfType<EndpointAnnotation>()); 852EndpointAnnotation endpoint = Assert.Single(projectA.Resource.Annotations.OfType<EndpointAnnotation>()); 919var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 935var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "https"); 951var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 968var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 985var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 1041var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "api"); 1059var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 1076var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 1093var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http");
WithHttpCommandTests.cs (2)
1082var endpointAnnotation = service.Resource.Annotations.OfType<EndpointAnnotation>().Single();
WithOtlpExporterTests.cs (12)
174var annotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == endpointName); 204var grpcAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 207var httpAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 259var grpcAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 316var dashboardAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 319var collectorAnnotation = collector.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "otlp-grpc");
WithReferenceTests.cs (4)
1208var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 1221var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>().Single();
WithUrlsTests.cs (1)
577foreach (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>(), 446var httpsEndpoint = Assert.Single(yarp.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "https"); 471Assert.DoesNotContain(yarp.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "https");
TestProject.AppHost (2)
TestProgram.cs (2)
183foreach (var endpoint in project.Annotations.OfType<EndpointAnnotation>())