70 instantiations of EndpointAnnotation
Aspire.Hosting (6)
Dashboard\DashboardEventHandlers.cs (4)
376dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: endpointContext.Scheme, isProxied: true)); 395dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: address.Scheme, port: address.Port, isProxied: true) 776annotation = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: context.Scheme, isProxied: true, transport: transport) 785annotation = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: address.Scheme, port: address.Port, isProxied: true, transport: transport)
ResourceBuilderExtensions.cs (2)
1482endpoint = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, networkId: KnownNetworkIdentifiers.LocalhostNetwork); 1604var 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 (2)
MauiPlatformExtensionsTests.cs (2)
683dashboard.Resource.Annotations.Add(new EndpointAnnotation( 738var dashboardEndpoint = 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)
690resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https")); 697resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"));
Dcp\ProxylessEndpointPortAllocatorTests.cs (1)
85return 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)
91dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: "http", port: 18889, isProxied: true, transport: transport)); 128dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2")); 129dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpHttpEndpointName, uriScheme: "http", port: 18890, isProxied: true)); 183dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2")); 213dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2"));
537 references to EndpointAnnotation
Aspire.Hosting (125)
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; } 75var endpoint = e.EndpointAnnotation;
ApplicationModel\ResolvedEndpoint.cs (1)
14public required EndpointAnnotation Endpoint { get; init; }
ApplicationModel\ResourceExtensions.cs (15)
733public static bool TryGetEndpoints(this IResource resource, [NotNullWhen(true)] out IEnumerable<EndpointAnnotation>? endpoints) 753/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 754/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 758if (TryGetAnnotationsOfType<EndpointAnnotation>(resource, out var endpoints)) 769/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 771/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 775if (TryGetAnnotationsOfType<EndpointAnnotation>(resource, out var endpoints)) 786/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 792var endpoint = resource.TryGetEndpoints(out var endpoints) ? 808/// <param name="resource">The <see cref="IResourceWithEndpoints"/> which contains <see cref="EndpointAnnotation"/> annotations.</param> 816var endpoint = resource.TryGetEndpoints(out var endpoints) ? 849foreach (var endpoint in endpoints) 851var publicPort = EndpointAnnotation.NormalizePort(endpoint.Port); 852var configuredTargetPort = EndpointAnnotation.NormalizePort(endpoint.TargetPort); 1850if (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)
355var endpointAnnotations = dashboardResource.Annotations.OfType<EndpointAnnotation>().ToList(); 356foreach (var endpointAnnotation in endpointAnnotations) 421var hasHttpsEndpoint = dashboardResource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints) && endpoints.Any(e => e.UriScheme is "https"); 772EndpointAnnotation annotation; 868.OfType<EndpointAnnotation>() 872foreach (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 (4)
25IEnumerable<EndpointAnnotation> Endpoints) 31var endpoints = resource.Annotations.OfType<EndpointAnnotation>().ToArray(); 423foreach (var endpoint in re.Endpoints) 1025var ea = sp.EndpointAnnotation;
Dcp\DcpExecutor.cs (10)
654.Select(r => (ModelResource: r, Endpoints: r.Annotations.OfType<EndpointAnnotation>().ToArray())) 661foreach (var endpoint in sp.Endpoints) 683foreach (var endpoint in endpoints) 747private static bool GetEffectiveIsProxied(IResource resource, EndpointAnnotation endpoint, bool randomizePorts) 780private static bool TryGetEffectiveFixedPublicPort(IResource resource, EndpointAnnotation endpoint, bool randomizePorts, out int publicPort) 782var effectivePublicPort = EndpointAnnotation.NormalizePort(resource.IsContainer() ? endpoint.SpecifiedPort : endpoint.Port); 802private void EnsureProxylessEndpointPort(IResource resource, EndpointAnnotation endpoint) 837private static bool NeedsPublicPort(IResource resource, EndpointAnnotation endpoint) 846private int? TryGetPersistedProxylessEndpointPort(IResource resource, EndpointAnnotation endpoint) 869private static string GetPersistedProxylessEndpointPortKey(IResource resource, EndpointAnnotation endpoint)
Dcp\DcpHost.cs (1)
665if (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; 298if (!TryGetEndpoint(res, ts.EndpointName, out var endpoint)) 336private static bool TryGetEndpoint(IResource resource, string? endpointName, [NotNullWhen(true)] out EndpointAnnotation? endpoint) 339if (resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints))
Dcp\DcpNameGenerator.cs (3)
109public (string, bool) GetServiceName(IResource resource, EndpointAnnotation endpoint, NetworkIdentifier targetNetworkId) 111var hasMultipleEndpoints = resource.Annotations.OfType<EndpointAnnotation>().Count() > 1; 176private static string NetworkServiceKey(IResource resource, EndpointAnnotation endpoint, NetworkIdentifier targetNetworkId)
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>())
Orchestrator\ApplicationOrchestrator.cs (2)
306EndpointAnnotation? primaryLaunchProfileEndpoint = null; 313foreach (var endpoint in endpoints)
ProjectResourceBuilderExtensions.cs (11)
52/// to build the equivalent <see cref="EndpointAnnotation"/>. 573if (!ctx.Resource.Annotations.OfType<EndpointAnnotation>().Any(e => e.TlsEnabled)) 651var adjustTransport = (EndpointAnnotation e, string? bindingLevelProtocols = null) => 760foreach (var endpoint in endpoints) 820EndpointAnnotation GetOrCreateEndpointForScheme(string scheme) 822EndpointAnnotation? GetEndpoint(string scheme) => 823projectResource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(sb => sb.UriScheme == scheme || string.Equals(sb.Name, scheme, StringComparisons.EndpointAnnotationName)); 825var endpoint = GetEndpoint(scheme); 849var httpEndpoint = GetOrCreateEndpointForScheme("http"); 850var httpsEndpoint = GetOrCreateEndpointForScheme("https"); 945this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter)
Publishing\ManifestPublishingContext.cs (3)
485/// <see cref="EndpointAnnotation"/> entries in the <see cref="IResource.Annotations"/> 488/// <param name="resource">The <see cref="IResource"/> that contains <see cref="EndpointAnnotation"/> annotations.</param> 498var endpoint = resolved.Endpoint;
ResourceBuilderExtensions.cs (18)
1184/// 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 1195/// Resource authors can opt out individual endpoints by setting <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> to <c>true</c> 1215/// 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 1227/// Resource authors can opt out individual endpoints by setting <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> to <c>true</c> 1438/// The <see cref="WithEndpoint{T}(IResourceBuilder{T}, string, Action{EndpointAnnotation}, bool)"/> method allows 1440/// other values to compatible/consistent values. For example setting the <see cref="EndpointAnnotation.Protocol"/> property 1441/// of the endpoint annotation in the callback will not automatically change the <see cref="EndpointAnnotation.UriScheme"/>. 1461public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string endpointName, Action<EndpointAnnotation> callback, bool createIfNotExists = true) where T : IResourceWithEndpoints 1467var endpoint = builder.Resource.Annotations 1468.OfType<EndpointAnnotation>() 1534!builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(endpoint => string.Equals(endpoint.Name, endpointName, StringComparisons.EndpointAnnotationName))) 1571var existing = builder.Resource.Annotations.OfType<EndpointAnnotation>() 1604var annotation = new EndpointAnnotation( 1647/// <see cref="EndpointAnnotation.TargetPortEnvironmentVariable"/> is updated 1650private static void ConfigureEndpointEnvironmentVariable<T>(IResourceBuilder<T> builder, EndpointAnnotation endpointAnnotation, string? env) where T : IResourceWithEndpoints 1862if (!builder.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 1867foreach (var endpoint in endpoints)
Aspire.Hosting.Azure.AppContainers (3)
AzureContainerAppEnvironmentResource.cs (1)
370var endpoint = endpointReference.EndpointAnnotation;
ContainerAppContext.cs (2)
223var endpoint = resolved.Endpoint; 262var endpoint = resolved.Endpoint;
Aspire.Hosting.Azure.AppService (2)
AzureAppServiceEnvironmentResource.cs (1)
522var endpoint = endpointReference.EndpointAnnotation;
AzureAppServiceWebsiteContext.cs (1)
126var 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 (2)
AzureSandboxContainerDeployment.cs (1)
1497private static string ResolveSandboxPortProtocol(IResource resource, EndpointAnnotation endpoint)
AzureSandboxEndpointPropertyValueProvider.cs (1)
29var endpoint = endpointReferenceExpression.Endpoint.EndpointAnnotation;
Aspire.Hosting.Azure.Tests (45)
AzureCosmosDBExtensionsTests.cs (16)
38var endpointAnnotation = cosmos.Resource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(); 793var emulatorEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulator"); 825var emulatorEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulator"); 854var dataExplorerEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 884var dataExplorerEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 996var endpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 1054var healthEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulatorhealth"); 1105var 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)
709private static List<EndpointAnnotation> GetAllocatedEndpoints(IResource resource) 711var endpoints = new List<EndpointAnnotation>(); 714if (annotation is EndpointAnnotation ep && ep.AllocatedEndpoint is not null) 723List<EndpointAnnotation> endpoints, string pathPrefix) 726foreach (var ep in endpoints)
BrowserDebuggerHelper.cs (2)
101EndpointAnnotation? endpointAnnotation = null; 102if (parentResource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints))
Aspire.Hosting.Blazor.Tests (1)
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)
546if (targetEndpoint.Resource.Annotations.OfType<EndpointAnnotation>()
Aspire.Hosting.Docker (1)
DockerComposeEnvironmentContext.cs (1)
45var endpoint = resolved.Endpoint;
Aspire.Hosting.Dotnet.Tests (2)
DotnetProjectResourceTests.cs (2)
495var endpoint = Assert.Single(app.Resource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Foundry (4)
HostedAgent\AzureHostedAgentResource.cs (1)
469var endpoint = endpointReference.EndpointAnnotation;
HostedAgent\HostedAgentBuilderExtension.cs (3)
293var existingHttpEndpoint = builder.Resource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(e => e.Name == "http"); 566targetWithEndpoints.Annotations.OfType<EndpointAnnotation>().Any(e => string.Equals(e.Name, "http", StringComparisons.EndpointAnnotationName)))
Aspire.Hosting.Foundry.Tests (7)
HostedAgentExtensionTests.cs (7)
66var httpEndpoint = endpoints.Single(e => e.Name == "http"); 169var endpoint = Assert.Single(agent.Resource.Annotations.OfType<EndpointAnnotation>()); 400var endpoint = Assert.Single(hostedAgent.Target.Annotations.OfType<EndpointAnnotation>()); 420var 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 (2)
JavaScriptHostingExtensions.cs (2)
2274EndpointAnnotation? endpointAnnotation = null; 2275if (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 (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)
237var endpoint = resolved.Endpoint; 280private void GenerateDefaultProjectEndpointMapping(EndpointAnnotation endpoint)
Aspire.Hosting.Maui (2)
MauiOtlpExtensions.cs (1)
228var endpoint = stubResource.OtlpEndpoint;
Otlp\OtlpLoopbackResource.cs (1)
54internal EndpointAnnotation OtlpEndpoint { get; }
Aspire.Hosting.Maui.Tests (7)
MauiPlatformExtensionsTests.cs (7)
648var endpointAnnotations = appBuilder.Resources.SelectMany(x => x.Annotations.OfType<EndpointAnnotation>()); 650foreach (var endpointAnnotation in endpointAnnotations) 695var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint; 703var dashboardEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 738var dashboardEndpoint = new EndpointAnnotation( 747var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint;
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.Radius (5)
Publishing\RadiusInfrastructureBuilder.cs (3)
1059/// Maps a compute resource's <see cref="EndpointAnnotation"/>s to Radius container ports, 1066if (!resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 1072foreach (var endpoint in endpoints)
RadiusEnvironmentResource.cs (2)
150var endpoint = endpointReference.EndpointAnnotation; 186private 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)
266var 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)
43var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 71var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 406var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 420var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 432var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 880var 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.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)
454var endpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == expectedScheme); 456var otlpGrpcEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 458var otlpHttpEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 536var httpEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "http"); 538var otlpGrpcEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 540var otlpHttpEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpHttpEndpointName);
Dashboard\DashboardResourceTests.cs (22)
210var otlpGrpcEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 211var otlpHttpEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 244var otlpGrpcEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 245var otlpHttpEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 287var otlpGrpcEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 288var otlpHttpEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 315var frontendEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name is "http" or "https"); 499var endpointAnnotation = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 503Assert.DoesNotContain(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 545var endpointAnnotation = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 549Assert.Contains(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 860foreach (var endpoint in dashboard.Annotations.OfType<EndpointAnnotation>())
Dcp\DcpExecutorTests.cs (5)
1078var computeEndpoint = compute.GetEndpoint("tcp").EndpointAnnotation; 1079var tunnelEndpoint = Assert.Single(tunnelPort.Annotations.OfType<EndpointAnnotation>()); 1120var endpoint = emulator.GetEndpoint("http").EndpointAnnotation; 8914var endpoint = resource.GetEndpoint(name).EndpointAnnotation;
Dcp\ProxylessEndpointPortAllocatorTests.cs (2)
76var endpoint = CreateEndpoint("endpoint"); 83private static EndpointAnnotation CreateEndpoint(string name)
DistributedApplicationTests.cs (1)
2346var 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)
326resource.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)
107var annotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == endpointName); 137var grpcAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 140var httpAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 192var grpcAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 249var dashboardAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 252var collectorAnnotation = collector.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "otlp-grpc");
WithReferenceTests.cs (4)
908var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 921var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>().Single();
WithUrlsTests.cs (1)
557foreach (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>())