80 instantiations of EndpointAnnotation
Aspire.Hosting (6)
Dashboard\DashboardEventHandlers.cs (4)
223dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: endpointContext.Scheme, isProxied: true));
242dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: address.Scheme, port: address.Port, isProxied: true)
647annotation = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: context.Scheme, isProxied: true, transport: transport)
656annotation = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: address.Scheme, port: address.Port, isProxied: true, transport: transport)
Aspire.Hosting.Azure.Tests (1)
Aspire.Hosting.Blazor.Tests (1)
Aspire.Hosting.DevTunnels (1)
Aspire.Hosting.Dotnet.Tests (2)
Aspire.Hosting.Maui (1)
Aspire.Hosting.Maui.Tests (9)
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)
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");
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");
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"));
WithOtlpExporterTests.cs (5)
158dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: "http", port: 18889, isProxied: true, transport: transport));
195dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2"));
196dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpHttpEndpointName, uriScheme: "http", port: 18890, isProxied: true));
250dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2"));
280dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2"));
627 references to EndpointAnnotation
Aspire.Hosting (135)
Dcp\DcpExecutor.cs (13)
638.Select(r => (ModelResource: r, Endpoints: r.Annotations.OfType<EndpointAnnotation>().ToArray()))
645foreach (var endpoint in sp.Endpoints)
662EndpointAnnotation.NormalizePort(endpoint.TargetPort) is int fixedTargetPort)
674foreach (var endpoint in endpoints)
738private static bool GetEffectiveIsProxied(IResource resource, EndpointAnnotation endpoint, bool randomizePorts)
775var endpoint = serviceProducer.EndpointAnnotation;
777EndpointAnnotation.NormalizePort(endpoint.TargetPort) is not null)
814private static bool TryGetEffectiveFixedPublicPort(IResource resource, EndpointAnnotation endpoint, bool randomizePorts, out int publicPort)
816var effectivePublicPort = EndpointAnnotation.NormalizePort(resource.IsContainer() ? endpoint.SpecifiedPort : endpoint.Port);
836private void EnsureProxylessEndpointPort(IResource resource, EndpointAnnotation endpoint)
871private static bool NeedsPublicPort(IResource resource, EndpointAnnotation endpoint)
880private int? TryGetPersistedProxylessEndpointPort(IResource resource, EndpointAnnotation endpoint)
905private static string GetPersistedProxylessEndpointPortKey(IResource resource, EndpointAnnotation endpoint)
ResourceBuilderExtensions.cs (18)
1496/// 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
1507/// Resource authors can opt out individual endpoints by setting <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> to <c>true</c>
1527/// 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
1539/// Resource authors can opt out individual endpoints by setting <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> to <c>true</c>
1750/// The <see cref="WithEndpoint{T}(IResourceBuilder{T}, string, Action{EndpointAnnotation}, bool)"/> method allows
1752/// other values to compatible/consistent values. For example setting the <see cref="EndpointAnnotation.Protocol"/> property
1753/// of the endpoint annotation in the callback will not automatically change the <see cref="EndpointAnnotation.UriScheme"/>.
1773public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string endpointName, Action<EndpointAnnotation> callback, bool createIfNotExists = true) where T : IResourceWithEndpoints
1779var endpoint = builder.Resource.Annotations
1780.OfType<EndpointAnnotation>()
1846!builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(endpoint => string.Equals(endpoint.Name, endpointName, StringComparisons.EndpointAnnotationName)))
1883var existing = builder.Resource.Annotations.OfType<EndpointAnnotation>()
1916var annotation = new EndpointAnnotation(
1959/// <see cref="EndpointAnnotation.TargetPortEnvironmentVariable"/> is updated
1962private static void ConfigureEndpointEnvironmentVariable<T>(IResourceBuilder<T> builder, EndpointAnnotation endpointAnnotation, string? env) where T : IResourceWithEndpoints
2174if (!builder.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints))
2179foreach (var endpoint in endpoints)
Aspire.Hosting.Azure.AppContainers (3)
Aspire.Hosting.Azure.AppService (2)
Aspire.Hosting.Azure.Kusto.Tests (4)
Aspire.Hosting.Azure.Sandboxes (1)
Aspire.Hosting.Azure.ServiceBus (1)
Aspire.Hosting.Azure.Tests (56)
Aspire.Hosting.Blazor (7)
Aspire.Hosting.Blazor.Tests (10)
Aspire.Hosting.Browsers (2)
Aspire.Hosting.Browsers.Tests (2)
Aspire.Hosting.DevTunnels (2)
Aspire.Hosting.Docker (1)
Aspire.Hosting.Dotnet (1)
Aspire.Hosting.Dotnet.Tests (25)
Aspire.Hosting.Foundry (4)
Aspire.Hosting.Foundry.Tests (7)
Aspire.Hosting.Garnet.Tests (4)
Aspire.Hosting.Java.Tests (10)
Aspire.Hosting.JavaScript (7)
Aspire.Hosting.JavaScript.Tests (10)
Aspire.Hosting.Kafka.Tests (5)
Aspire.Hosting.Keycloak.Tests (6)
Aspire.Hosting.Kubernetes (4)
Aspire.Hosting.Maui (5)
Aspire.Hosting.Maui.Tests (22)
Aspire.Hosting.Milvus.Tests (7)
Aspire.Hosting.MongoDB (1)
Aspire.Hosting.MongoDB.Tests (8)
Aspire.Hosting.MySql.Tests (4)
Aspire.Hosting.Nats.Tests (4)
Aspire.Hosting.Oracle.Tests (6)
Aspire.Hosting.PostgreSQL.Tests (14)
Aspire.Hosting.Qdrant.Tests (11)
Aspire.Hosting.RabbitMQ.Tests (4)
Aspire.Hosting.Radius (7)
Aspire.Hosting.Radius.Tests (1)
Aspire.Hosting.Redis (2)
Aspire.Hosting.Redis.Tests (12)
Aspire.Hosting.Seq.Tests (8)
Aspire.Hosting.SqlServer.Tests (4)
Aspire.Hosting.Testing.Tests (2)
Aspire.Hosting.Tests (186)
ApplicationModel\McpServerEndpointAnnotationTests.cs (8)
73var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http");
88var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http");
103var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http");
119var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http");
135var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http");
150var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http");
165var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http");
182var endpointAnnotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https");
ConditionalReferenceExpressionTests.cs (5)
77var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http");
126var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp");
140var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "tcp")
157var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp");
170var annotation = new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "tcp");
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");
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>());
Aspire.Hosting.Valkey.Tests (4)
Aspire.Hosting.Yarp.Tests (4)
TestProject.AppHost (2)