90 instantiations of EndpointAnnotation
Aspire.Hosting (6)
Dashboard\DashboardEventHandlers.cs (4)
226dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: endpointContext.Scheme, isProxied: true)); 245dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: address.Scheme, port: address.Port, isProxied: true) 650annotation = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: context.Scheme, isProxied: true, transport: transport) 659annotation = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: address.Scheme, port: address.Port, isProxied: true, transport: transport)
ResourceBuilderExtensions.cs (2)
1787endpoint = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, networkId: KnownNetworkIdentifiers.LocalhostNetwork); 1909var annotation = new EndpointAnnotation(
Aspire.Hosting.Azure.Tests (1)
AzureStorageExtensionsTests.cs (1)
434=> new(storage.Resource, new EndpointAnnotation(ProtocolType.Tcp, name: name, targetPort: port));
Aspire.Hosting.Blazor.Tests (1)
GatewayConfigurationBuilderTests.cs (1)
631var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https");
Aspire.Hosting.DevTunnels (1)
DevTunnelResource.cs (1)
76TunnelEndpointAnnotation = new EndpointAnnotation(
Aspire.Hosting.Dotnet.Tests (2)
DotnetProjectFacadeTests.cs (2)
27Assert.True(filter(new EndpointAnnotation(System.Net.Sockets.ProtocolType.Tcp, uriScheme: "http", name: "http"))); 28Assert.False(filter(new EndpointAnnotation(System.Net.Sockets.ProtocolType.Tcp, uriScheme: "http", name: "admin")));
Aspire.Hosting.Maui (1)
Otlp\OtlpLoopbackResource.cs (1)
31OtlpEndpoint = new EndpointAnnotation(
Aspire.Hosting.Maui.Tests (9)
MauiPlatformExtensionsTests.cs (9)
753dashboard.Resource.Annotations.Add(new EndpointAnnotation( 806dashboard.Resource.Annotations.Add(new EndpointAnnotation( 812dashboard.Resource.Annotations.Add(new EndpointAnnotation( 870var dashboardEndpoint = new EndpointAnnotation( 909dashboard.Resource.Annotations.Add(new EndpointAnnotation( 966var dashboardEndpoint = new EndpointAnnotation( 1192dashboard.Resource.Annotations.Add(new EndpointAnnotation( 1274dashboard.Resource.Annotations.Add(new EndpointAnnotation( 1310dashboard.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)
495var endpoint = new EndpointAnnotation(System.Net.Sockets.ProtocolType.Tcp, uriScheme: endpointName, name: endpointName);
Aspire.Hosting.Tests (61)
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)
115var endpoint = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: uriScheme, name: uriScheme, port: port, targetPort: targetPort);
ConditionalReferenceExpressionTests.cs (5)
82var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 246var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp"); 260var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "tcp") 277var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp"); 290var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp");
Dcp\DcpHostNotificationTests.cs (2)
1022resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https")); 1029resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"));
Dcp\ProxylessEndpointPortAllocatorTests.cs (1)
393return new EndpointAnnotation(ProtocolType.Tcp, name: name, isProxied: false);
EndpointReferenceTests.cs (33)
53var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 71var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 90var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 105var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 124var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 143var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https"); 157var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 171var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", targetPort: 5000); 185var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 204var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 222var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 253var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 266var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 279var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 292var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https"); 305var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", targetPort: 5000); 318var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 330var annotation = new EndpointAnnotation(ProtocolType.Tcp, KnownNetworkIdentifiers.LocalhostNetwork, uriScheme: "http", name: "http"); 402var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "blah", name: "http"); 446var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 476var httpEndpoint = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "http"); 492resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http")); 493resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "tcp", name: "grpc")); 520resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http")); 547resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https")); 568resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: scheme)); 581resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https")); 598resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http")); 599resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https")); 611resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http")); 629resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http")); 651resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http")); 665resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http"));
ExecutionConfigurationGathererTests.cs (1)
224.WithAnnotation(new EndpointAnnotation(
ExpressionResolverTests.cs (2)
197var nonHostEndpoint = new EndpointAnnotation( 282var endpoint = new EndpointAnnotation(System.Net.Sockets.ProtocolType.Tcp, KnownNetworkIdentifiers.DefaultAspireContainerNetwork)
ResourceDependencyTests.cs (1)
77var nonHostEndpoint = new EndpointAnnotation(
WithEndpointTests.cs (1)
115var endpoint = new EndpointAnnotation(ProtocolType.Tcp);
WithOtlpExporterTests.cs (5)
160dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: "http", port: 18889, isProxied: true, transport: transport)); 197dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2")); 198dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpHttpEndpointName, uriScheme: "http", port: 18890, isProxied: true)); 252dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2")); 282dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2"));
660 references to EndpointAnnotation
Aspire.Hosting (139)
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)
35/// Initializes a new instance of <see cref="EndpointAnnotation"/>. 68/// Initializes a new instance of <see cref="EndpointAnnotation"/>. 101/// Initializes a new instance of <see cref="EndpointAnnotation"/>. 133ModelName.ValidateName(nameof(EndpointAnnotation), name); 150/// 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)
18private EndpointAnnotation? _endpointAnnotation; 25public EndpointAnnotation EndpointAnnotation => GetEndpointAnnotation() ?? throw new InvalidOperationException(ErrorMessage ?? BuildMissingEndpointMessage()); 30.OfType<EndpointAnnotation>() 119/// Once the annotation exists, this property delegates to <see cref="EndpointAnnotation.TlsEnabled"/>. 137/// Once the annotation exists, this property delegates to <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/>. 202/// <see cref="EndpointAnnotation.TlsEnabled"/> is <see langword="true"/> on this endpoint, or to 259private EndpointAnnotation? GetEndpointAnnotation() 266_endpointAnnotation ??= Resource.Annotations.OfType<EndpointAnnotation>() 274var endpointAnnotation = GetEndpointAnnotation(); 297public EndpointReference(IResourceWithEndpoints owner, EndpointAnnotation endpoint, NetworkIdentifier? contextNetworkId) 313public 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)
144var endpoint = resource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(endpoint => MatchesHostPort(endpoint, port)); 154internal static bool MatchesHostPort(EndpointAnnotation endpoint, int port)
ApplicationModel\IComputeEnvironmentResource.cs (2)
51var endpoint = endpointReference.EndpointAnnotation; 79private 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)
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); 2012if (resource.Annotations.OfType<EndpointAnnotation>().Any(ep => HostUrl.MatchesHostPort(ep, port)) && dependencies.Add(resource))
Backchannel\AppHostRpcTarget.cs (1)
138endpoints = Enumerable.Empty<EndpointAnnotation>();
BuiltInDistributedApplicationEventSubscriptionHandlers.cs (2)
59var httpEndpoints = resource.Annotations.OfType<EndpointAnnotation>().Where(sb => sb.UriScheme == "http" || sb.UriScheme == "https"); 60foreach (var httpEndpoint in httpEndpoints)
Dashboard\DashboardEventHandlers.cs (6)
205var endpointAnnotations = dashboardResource.Annotations.OfType<EndpointAnnotation>().ToList(); 206foreach (var endpointAnnotation in endpointAnnotations) 271var hasHttpsEndpoint = dashboardResource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints) && endpoints.Any(e => e.UriScheme is "https"); 646EndpointAnnotation annotation; 742.OfType<EndpointAnnotation>() 746foreach (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 (2)
369private async Task<EndpointAnnotation[]> GetDashboardTunnelEndpointsAsync( 764var 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 (8)
669.Select(r => (ModelResource: r, Endpoints: r.Annotations.OfType<EndpointAnnotation>().ToArray())) 676foreach (var endpoint in sp.Endpoints) 688foreach (var endpoint in endpoints) 759private static bool GetEffectiveIsProxied(IResource resource, EndpointAnnotation endpoint, bool randomizePorts) 796var endpoint = serviceProducer.EndpointAnnotation; 798EndpointAnnotation.NormalizePort(endpoint.TargetPort) is not null) 822private void EnsureProxylessEndpointPort(IResource resource, EndpointAnnotation endpoint) 843private static PersistentPortAllocationKey GetPersistentPublicPortKey(IResource resource, EndpointAnnotation endpoint)
Dcp\DcpHost.cs (1)
767if (resource.Annotations.OfType<EndpointAnnotation>().Any(e => e.UriScheme is "https"))
Dcp\DcpModelUtilities.cs (12)
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."); 58internal static bool TryGetEffectiveFixedPublicPort(IResource resource, EndpointAnnotation endpoint, bool randomizePorts, out int publicPort) 60var effectivePublicPort = EndpointAnnotation.NormalizePort(resource.IsContainer() ? endpoint.SpecifiedPort : endpoint.Port); 78internal static bool NeedsGeneratedPublicPort(IResource resource, EndpointAnnotation endpoint, bool randomizePorts) 104var ea = sp.EndpointAnnotation; 345if (!TryGetEndpoint(res, ts.EndpointName, out var endpoint)) 383private static bool TryGetEndpoint(IResource resource, string? endpointName, [NotNullWhen(true)] out EndpointAnnotation? endpoint) 386if (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)
136var endpointsByResource = new Dictionary<IResourceWithEndpoints, HashSet<EndpointAnnotation>>(ReferenceEqualityComparer.Instance); 168endpoints = new HashSet<EndpointAnnotation>(ReferenceEqualityComparer.Instance);
Dcp\PersistentPortAllocator.cs (2)
126foreach (var endpoint in endpoints) 135EndpointAnnotation.NormalizePort(endpoint.TargetPort) is int fixedTargetPort)
Dcp\ProxylessEndpointPortAllocator.cs (2)
44private readonly Dictionary<EndpointAnnotation, int> _reservedPorts = new(ReferenceEqualityComparer.Instance); 93public 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 (5)
324var resourceEndpoints = resource.Annotations.OfType<EndpointAnnotation>().ToArray(); 325EndpointAnnotation? primaryLaunchProfileEndpoint = null; 332foreach (var endpoint in endpoints) 597foreach (var endpoint in resourceEndpoints) 623foreach (var endpoint in resourceEndpoints)
ProjectResourceBuilderExtensions.cs (11)
56/// to build the equivalent <see cref="EndpointAnnotation"/>. 643if (!ctx.Resource.Annotations.OfType<EndpointAnnotation>().Any(e => e.TlsEnabled)) 732var adjustTransport = (EndpointAnnotation e, string? bindingLevelProtocols = null) => 841foreach (var endpoint in endpoints) 901EndpointAnnotation GetOrCreateEndpointForScheme(string scheme) 903EndpointAnnotation? GetEndpoint(string scheme) => 904projectResource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(sb => sb.UriScheme == scheme || string.Equals(sb.Name, scheme, StringComparisons.EndpointAnnotationName)); 906var endpoint = GetEndpoint(scheme); 930var httpEndpoint = GetOrCreateEndpointForScheme("http"); 931var httpsEndpoint = GetOrCreateEndpointForScheme("https"); 1028this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter)
Publishing\ManifestPublishingContext.cs (3)
550/// <see cref="EndpointAnnotation"/> entries in the <see cref="IResource.Annotations"/> 553/// <param name="resource">The <see cref="IResource"/> that contains <see cref="EndpointAnnotation"/> annotations.</param> 563var endpoint = resolved.Endpoint;
ResourceBuilderExtensions.cs (18)
1489/// 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 1500/// Resource authors can opt out individual endpoints by setting <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> to <c>true</c> 1520/// 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 1532/// Resource authors can opt out individual endpoints by setting <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> to <c>true</c> 1743/// The <see cref="WithEndpoint{T}(IResourceBuilder{T}, string, Action{EndpointAnnotation}, bool)"/> method allows 1745/// other values to compatible/consistent values. For example setting the <see cref="EndpointAnnotation.Protocol"/> property 1746/// of the endpoint annotation in the callback will not automatically change the <see cref="EndpointAnnotation.UriScheme"/>. 1766public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string endpointName, Action<EndpointAnnotation> callback, bool createIfNotExists = true) where T : IResourceWithEndpoints 1772var endpoint = builder.Resource.Annotations 1773.OfType<EndpointAnnotation>() 1839!builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(endpoint => string.Equals(endpoint.Name, endpointName, StringComparisons.EndpointAnnotationName))) 1876var existing = builder.Resource.Annotations.OfType<EndpointAnnotation>() 1909var annotation = new EndpointAnnotation( 1952/// <see cref="EndpointAnnotation.TargetPortEnvironmentVariable"/> is updated 1955private static void ConfigureEndpointEnvironmentVariable<T>(IResourceBuilder<T> builder, EndpointAnnotation endpointAnnotation, string? env) where T : IResourceWithEndpoints 2167if (!builder.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 2172foreach (var endpoint in endpoints)
Aspire.Hosting.Azure.AppContainers (3)
AzureContainerAppEnvironmentResource.cs (1)
429var endpoint = endpointReference.EndpointAnnotation;
ContainerAppContext.cs (2)
230var endpoint = resolved.Endpoint; 270var endpoint = resolved.Endpoint;
Aspire.Hosting.Azure.AppService (2)
AzureAppServiceEnvironmentResource.cs (1)
561var endpoint = endpointReference.EndpointAnnotation;
AzureAppServiceWebsiteContext.cs (1)
158var endpoint = resolved.Endpoint;
Aspire.Hosting.Azure.Kusto.Tests (4)
AddAzureKustoTests.cs (4)
67var endpointAnnotations = resourceBuilder.Resource.Annotations.OfType<EndpointAnnotation>().ToList(); 68var httpEndpoint = endpointAnnotations.SingleOrDefault(e => e.Name == "http"); 357var endpointAnnotations = resourceBuilder.Resource.Annotations.OfType<EndpointAnnotation>().ToList(); 358var httpEndpoint = endpointAnnotations.SingleOrDefault(e => e.Name == "http");
Aspire.Hosting.Azure.Sandboxes (1)
AzureSandboxContainerDeployment.cs (1)
1573private static string ResolveSandboxPortProtocol(IResource resource, EndpointAnnotation endpoint)
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusExtensions.cs (1)
466if (!sqlServerBuilder.Resource.Annotations.OfType<EndpointAnnotation>().Any(e => e.Name == SqlServerEndpointName))
Aspire.Hosting.Azure.Tests (57)
AzureCosmosDBExtensionsTests.cs (16)
39var endpointAnnotation = cosmos.Resource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(); 820var emulatorEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulator"); 852var emulatorEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulator"); 881var dataExplorerEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 911var dataExplorerEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 1024var endpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 1084var healthEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulatorhealth"); 1135var endpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer");
AzureEventHubsExtensionsTests.cs (1)
243var endpoints = eventHubs.Resource.Annotations.OfType<EndpointAnnotation>().ToList();
AzureFunctionsTests.cs (17)
59Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 87Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 110Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 124Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 138Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 216Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 260Assert.True(functionsResource.TryGetLastAnnotation<EndpointAnnotation>(out var endpointAnnotation)); 461Assert.DoesNotContain(functionsResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "debug"); 488var endpoint = Assert.Single(funcApp.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http");
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 (7)
167serviceBus.Resource.Annotations.OfType<EndpointAnnotation>(), 712var endpoint = Assert.Single(sql.Annotations.OfType<EndpointAnnotation>()); 807var endpoint = sql.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "tcp"); 984var endpoint = resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "tcp");
AzureSqlExtensionsTests.cs (3)
47Assert.Equal(1433, Assert.Single(server.Annotations.OfType<EndpointAnnotation>()).TargetPort); 340var endpoint = Assert.Single(innerSql.Resource.Annotations.OfType<EndpointAnnotation>());
AzureStorageExtensionsTests.cs (1)
133storage.Resource.Annotations.OfType<EndpointAnnotation>(),
AzureWebPubSubEmulatorTests.cs (2)
58var endpoint = api.GetEndpoint("http").EndpointAnnotation; 151var endpoint = webPubSub.GetEndpoint("emulator").EndpointAnnotation;
DurableTaskResourceExtensionsTests.cs (4)
218var endpointAnnotations = dts.Resource.Annotations.OfType<EndpointAnnotation>().ToList(); 220var grpc = endpointAnnotations.SingleOrDefault(e => e.Name == "grpc"); 224var http = endpointAnnotations.SingleOrDefault(e => e.Name == "http"); 229var dashboard = endpointAnnotations.SingleOrDefault(e => e.Name == "dashboard");
Aspire.Hosting.Blazor (7)
BlazorGatewayExtensions.cs (5)
864private static List<EndpointAnnotation> GetAllocatedEndpoints(IResource resource) 866var endpoints = new List<EndpointAnnotation>(); 869if (annotation is EndpointAnnotation ep && ep.AllocatedEndpoint is not null) 878List<EndpointAnnotation> endpoints, string pathPrefix) 881foreach (var ep in endpoints)
BrowserDebuggerHelper.cs (2)
101EndpointAnnotation? endpointAnnotation = null; 102if (parentResource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints))
Aspire.Hosting.Blazor.Tests (10)
AddBlazorGatewayTests.cs (7)
77gateway.Resource.Annotations.OfType<EndpointAnnotation>().OrderBy(endpoint => endpoint.Name), 244var backendEndpoint = backend.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 250gateway.Resource.Annotations.Remove(gateway.Resource.Annotations.OfType<EndpointAnnotation>().Single(endpoint => endpoint.Name == "https")); 298var endpoint = gateway.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 299endpoint.AllocatedEndpoint = context.Resource.Annotations.OfType<EndpointAnnotation>().Single().AllocatedEndpoint;
AddDotnetProjectBlazorGatewayTests.cs (1)
29gateway.Resource.Annotations.OfType<EndpointAnnotation>().Select(e => e.Name));
GatewayConfigurationBuilderTests.cs (2)
628private static (EndpointReference Endpoint, EndpointAnnotation Annotation) CreateHttpsHostEndpoint() 631var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https");
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)
575if (targetEndpoint.Resource.Annotations.OfType<EndpointAnnotation>()
Aspire.Hosting.Docker (1)
DockerComposeEnvironmentContext.cs (1)
45var endpoint = resolved.Endpoint;
Aspire.Hosting.Dotnet (1)
DotnetProjectHostingExtensions.cs (1)
235Func<EndpointAnnotation, bool> filter)
Aspire.Hosting.Dotnet.Tests (25)
DotnetProjectFacadeTests.cs (2)
123foreach (var endpoint in resource.Resource.Annotations.OfType<EndpointAnnotation>())
DotnetProjectLaunchProfileTests.cs (16)
49var endpoint = Assert.Single(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 61Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 96Assert.Equal(port, Assert.Single(resource.Resource.Annotations.OfType<EndpointAnnotation>()).Port); 100Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 138Assert.Equal(port, Assert.Single(resource.Resource.Annotations.OfType<EndpointAnnotation>()).Port); 142Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 180Assert.Equal(5111, Assert.Single(modern.Resource.Annotations.OfType<EndpointAnnotation>()).Port); 183Assert.Equal(5222, Assert.Single(legacy.Resource.Annotations.OfType<EndpointAnnotation>()).Port); 187Assert.Empty(legacy.Resource.Annotations.OfType<EndpointAnnotation>()); 211Assert.Equal(5222, Assert.Single(resource.Resource.Annotations.OfType<EndpointAnnotation>()).Port); 215Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 233Assert.Equal(5222, Assert.Single(resource.Resource.Annotations.OfType<EndpointAnnotation>()).Port); 237Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 255Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 273Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>());
DotnetProjectOptionsTests.cs (3)
60var endpoint = Assert.Single(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 89var endpoints = resource.Annotations.OfType<EndpointAnnotation>();
DotnetProjectResourceTests.cs (4)
440var endpoint = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 559var endpoint = Assert.Single(app.Resource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Foundry (4)
HostedAgent\AzureHostedAgentResource.cs (1)
493var 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)
70var httpEndpoint = endpoints.Single(e => e.Name == "http"); 173var endpoint = Assert.Single(agent.Resource.Annotations.OfType<EndpointAnnotation>()); 404var endpoint = Assert.Single(hostedAgent.Target.Annotations.OfType<EndpointAnnotation>()); 424var endpoint = Assert.Single(hostedAgent.Target.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Garnet.Tests (4)
AddGarnetTests.cs (4)
28var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 56var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Java.Tests (10)
AddJavaContainerTests.cs (1)
104Assert.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)
131public EndpointAnnotation? ServeEndpoint { get; set; }
DenoHostingExtensions.cs (4)
405var existingEndpoint = builder.Resource.Annotations 406.OfType<EndpointAnnotation>() 414var serveEndpoint = builder.Resource.Annotations 415.OfType<EndpointAnnotation>()
JavaScriptHostingExtensions.cs (2)
2975EndpointAnnotation? endpointAnnotation = null; 2976if (parentResource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints))
Aspire.Hosting.JavaScript.Tests (10)
AddDenoAppTests.cs (8)
1132Assert.Empty(denoApp.Resource.Annotations.OfType<EndpointAnnotation>()); 1156var endpoint = Assert.Single(denoApp.Resource.Annotations.OfType<EndpointAnnotation>()); 1185var endpoint = Assert.Single(denoApp.Resource.Annotations.OfType<EndpointAnnotation>()); 1201var callerEndpoint = denoApp.Resource.GetEndpoint("http").EndpointAnnotation; 1206var 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)
277var endpoint = resolved.Endpoint; 320private 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)
718var endpointAnnotations = appBuilder.Resources.SelectMany(x => x.Annotations.OfType<EndpointAnnotation>()); 720foreach (var endpointAnnotation in endpointAnnotations) 765var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint; 773var dashboardEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 824var httpEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>() 827var grpcEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>() 835var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint; 870var dashboardEndpoint = new EndpointAnnotation( 934var dashboardEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 945var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint; 966var dashboardEndpoint = new EndpointAnnotation( 975var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint; 1032var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint; 1166var stubEndpoint = tunnelConfig.OtlpStub.OtlpEndpoint; 1212var dashboardEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 1322var 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>() 201Assert.Single(milvusResource.Annotations.OfType<EndpointAnnotation>()); 203var grpcEndpoint = milvusResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc");
Aspire.Hosting.MongoDB (1)
MongoDBServerResource.cs (1)
105/// This property proxies through to <see cref="EndpointAnnotation.TlsEnabled"/> on the <see cref="PrimaryEndpoint"/>,
Aspire.Hosting.MongoDB.Tests (8)
AddMongoDBTests.cs (6)
51var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 79var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 218var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
SingleMemberReplicaSetTests.cs (2)
39var 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>() 426Assert.Equal(2, qdrantResource.Annotations.OfType<EndpointAnnotation>().Count()); 428var grpcEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc"); 436var 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)
3441/// <see cref="EndpointAnnotation.TlsEnabled"/> set, which describes how the container runs 3500var endpoints = resource.Annotations.OfType<EndpointAnnotation>().ToList(); 3588/// Maps a compute resource's <see cref="EndpointAnnotation"/>s to Radius container ports, 3595if (!resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints)) 3601foreach (var endpoint in endpoints)
RadiusEnvironmentResource.cs (2)
176var endpoint = endpointReference.EndpointAnnotation; 315private 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)
326var secondaryEndpoint = endpoints.FirstOrDefault(ep => string.Equals(ep.Name, RedisResource.SecondaryEndpointName, StringComparisons.EndpointAnnotationName));
RedisResource.cs (1)
71/// This property proxies through to <see cref="EndpointAnnotation.TlsEnabled"/> on the
Aspire.Hosting.Redis.Tests (15)
AddRedisTests.cs (15)
45var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 73var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 480var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 494var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 506var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 1014var endpoint = Assert.Single(redis.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "tcp"); 1040var endpoints = redis.Resource.Annotations.OfType<EndpointAnnotation>().ToArray(); 1042var primaryEndpoint = Assert.Single(endpoints, e => e.Name == "tcp"); 1047var secondaryEndpoint = Assert.Single(endpoints, e => e.Name == "secondary");
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)
53var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 265var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
Aspire.Hosting.Testing.Tests (2)
TestingPublicApiTests.cs (2)
493private static EndpointAnnotation CreateAllocatedEndpoint(string endpointName, int port) 495var endpoint = new EndpointAnnotation(System.Net.Sockets.ProtocolType.Tcp, uriScheme: endpointName, name: endpointName);
Aspire.Hosting.Tests (211)
AddConnectionStringTests.cs (1)
99var annotation = endpoint.EndpointAnnotation;
ApplicationModel\Docker\WithDockerfileBuilderTests.cs (2)
471var 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)
2262var 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)
115var endpoint = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: uriScheme, name: uriScheme, port: port, targetPort: targetPort);
ConditionalReferenceExpressionTests.cs (5)
82var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 246var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp"); 260var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "tcp") 277var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp"); 290var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp");
Dashboard\DashboardEventHandlersTests.cs (12)
633var endpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == expectedScheme); 635var otlpGrpcEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 637var otlpHttpEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 715var httpEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "http"); 717var otlpGrpcEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 719var otlpHttpEndpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpHttpEndpointName);
Dashboard\DashboardResourceTests.cs (22)
228var otlpGrpcEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 229var otlpHttpEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 262var otlpGrpcEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 263var otlpHttpEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 305var otlpGrpcEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 306var otlpHttpEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 333var frontendEndpoint = Assert.Single(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name is "http" or "https"); 517var endpointAnnotation = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 521Assert.DoesNotContain(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 563var endpointAnnotation = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 567Assert.Contains(dashboard.Annotations.OfType<EndpointAnnotation>(), e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 880foreach (var endpoint in dashboard.Annotations.OfType<EndpointAnnotation>())
Dcp\DcpExecutorTests.cs (5)
1677var computeEndpoint = compute.GetEndpoint("tcp").EndpointAnnotation; 1678var tunnelEndpoint = Assert.Single(tunnelPort.Annotations.OfType<EndpointAnnotation>()); 1719var endpoint = emulator.GetEndpoint("http").EndpointAnnotation; 10928var endpoint = resource.GetEndpoint(name).EndpointAnnotation;
Dcp\ProxylessEndpointPortAllocatorTests.cs (2)
78var endpoint = CreateEndpoint("endpoint"); 391private static EndpointAnnotation CreateEndpoint(string name)
DistributedApplicationTests.cs (1)
2434var hasMultipleEndpoints = redis.Annotations.OfType<EndpointAnnotation>().Count() > 1;
EndpointReferenceTests.cs (24)
27Assert.Same(web.Resource.Annotations.OfType<EndpointAnnotation>().Single(), endpoint.EndpointAnnotation); 46Assert.Same(web.Resource.Annotations.OfType<EndpointAnnotation>().Single(), endpoint.EndpointAnnotation); 53var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 71var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 90var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 105var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 124var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 143var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https"); 157var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 171var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", targetPort: 5000); 185var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 204var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 222var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 253var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 266var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 279var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 292var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https"); 305var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", targetPort: 5000); 318var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 330var annotation = new EndpointAnnotation(ProtocolType.Tcp, KnownNetworkIdentifiers.LocalhostNetwork, uriScheme: "http", name: "http"); 353var annotation = endpoint.EndpointAnnotation; 402var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "blah", name: "http"); 446var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"); 476var httpEndpoint = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "http");
ExpressionResolverTests.cs (4)
197var nonHostEndpoint = new EndpointAnnotation( 282var endpoint = new EndpointAnnotation(System.Net.Sockets.ProtocolType.Tcp, KnownNetworkIdentifiers.DefaultAspireContainerNetwork) 336var 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>(), 457foreach (var endpoint in resource.Annotations.OfType<EndpointAnnotation>())
Orchestrator\ApplicationOrchestratorTests.cs (20)
41var endpoint = resource.GetEndpoint("http").EndpointAnnotation; 100var endpoint = resource.GetEndpoint("http").EndpointAnnotation; 135var endpoint = resource.GetEndpoint("http").EndpointAnnotation; 171var endpoint = resource.GetEndpoint("http").EndpointAnnotation; 201var endpoint = item.GetEndpoint("http").EndpointAnnotation; 306var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 356var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 411var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 438var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 476var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 496var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 521var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 523var httpsEndpoint = frontend.GetEndpoint("https").EndpointAnnotation; 544var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 571var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 1152var endpoint = Assert.Single(endpointResource.Annotations.OfType<EndpointAnnotation>()); 1205var endpoint = Assert.Single(member.Resource.Annotations.OfType<EndpointAnnotation>()); 1257var annotation = endpoint.EndpointAnnotation;
ProjectResourceTests.cs (1)
355resource.Annotations.OfType<EndpointAnnotation>(),
PublishAsDockerfileTests.cs (6)
284Assert.Empty(container.Annotations.OfType<EndpointAnnotation>()); 303var endpoint = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 329var endpoint = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 351var endpoints = container.Annotations.OfType<EndpointAnnotation>().OrderBy(e => e.Name).ToList();
ResourceDependencyTests.cs (1)
77var 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)
85typeof(EndpointAnnotation), 96typeof(EndpointAnnotation), 107var isProxiedProperty = typeof(EndpointAnnotation).GetProperty(nameof(EndpointAnnotation.IsProxied), BindingFlags.Public | BindingFlags.Instance); 115var endpoint = new EndpointAnnotation(ProtocolType.Tcp); 125typeof(EndpointAnnotation), 135var endpoint = Assert.IsType<EndpointAnnotation>(constructor!.Invoke([ProtocolType.Tcp, "http", null, "http", null, null, null, true])); 149var endpoint = Assert.Single(container.Resource.Annotations.OfType<EndpointAnnotation>()); 162var endpoint = Assert.Single(container.Resource.Annotations.OfType<EndpointAnnotation>()); 197var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>() 213var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>() 239var endpoints = resource.Annotations.OfType<EndpointAnnotation>().ToArray(); 658var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 674var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "https"); 690var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 707var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 724var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 780var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "api"); 798var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 815var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 832var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 860var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 877var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 912var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 950Assert.False(projectA.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var annotations)); 967Assert.True(projectA.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out _)); 984Assert.True(projectA.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out _)); 997var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "mybinding"); 1012var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "https"); 1026var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "mybinding"); 1038var endpoint = projectA.Resource.Annotations.OfType<EndpointAnnotation>() 1074EndpointAnnotation endpoint = Assert.Single(projectA.Resource.Annotations.OfType<EndpointAnnotation>()); 1108EndpointAnnotation endpoint = Assert.Single(projectA.Resource.Annotations.OfType<EndpointAnnotation>());
WithHttpCommandTests.cs (2)
1082var endpointAnnotation = service.Resource.Annotations.OfType<EndpointAnnotation>().Single();
WithOtlpExporterTests.cs (12)
176var annotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == endpointName); 206var grpcAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 209var httpAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 261var grpcAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 318var dashboardAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 321var collectorAnnotation = collector.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "otlp-grpc");
WithReferenceTests.cs (4)
237var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 250var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>().Single();
WithUrlsTests.cs (2)
70var annotation = endpoint.EndpointAnnotation; 123foreach (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)
186foreach (var endpoint in project.Annotations.OfType<EndpointAnnotation>())