77 instantiations of EndpointAnnotation
Aspire.Hosting (6)
Dashboard\DashboardEventHandlers.cs (4)
223dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: endpointContext.Scheme, isProxied: true));
242dashboardResource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: address.Scheme, port: address.Port, isProxied: true)
621annotation = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: context.Scheme, isProxied: true, transport: transport)
630annotation = new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: address.Scheme, port: address.Port, isProxied: true, transport: transport)
Aspire.Hosting.Azure.Tests (1)
Aspire.Hosting.DevTunnels (1)
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"));
594 references to EndpointAnnotation
Aspire.Hosting (135)
Dcp\DcpExecutor.cs (13)
639.Select(r => (ModelResource: r, Endpoints: r.Annotations.OfType<EndpointAnnotation>().ToArray()))
646foreach (var endpoint in sp.Endpoints)
663EndpointAnnotation.NormalizePort(endpoint.TargetPort) is int fixedTargetPort)
675foreach (var endpoint in endpoints)
739private static bool GetEffectiveIsProxied(IResource resource, EndpointAnnotation endpoint, bool randomizePorts)
776var endpoint = serviceProducer.EndpointAnnotation;
778EndpointAnnotation.NormalizePort(endpoint.TargetPort) is not null)
815private static bool TryGetEffectiveFixedPublicPort(IResource resource, EndpointAnnotation endpoint, bool randomizePorts, out int publicPort)
817var effectivePublicPort = EndpointAnnotation.NormalizePort(resource.IsContainer() ? endpoint.SpecifiedPort : endpoint.Port);
837private void EnsureProxylessEndpointPort(IResource resource, EndpointAnnotation endpoint)
872private static bool NeedsPublicPort(IResource resource, EndpointAnnotation endpoint)
881private int? TryGetPersistedProxylessEndpointPort(IResource resource, EndpointAnnotation endpoint)
906private static string GetPersistedProxylessEndpointPortKey(IResource resource, EndpointAnnotation endpoint)
ResourceBuilderExtensions.cs (18)
1246/// Each non-excluded endpoint (where <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> is <c>false</c>) defined on the source resource will be injected using the format defined by
1257/// Resource authors can opt out individual endpoints by setting <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> to <c>true</c>
1277/// Each non-excluded endpoint (where <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> is <c>false</c>) defined on the source resource will be injected using the format defined by
1289/// Resource authors can opt out individual endpoints by setting <see cref="EndpointAnnotation.ExcludeReferenceEndpoint"/> to <c>true</c>
1500/// The <see cref="WithEndpoint{T}(IResourceBuilder{T}, string, Action{EndpointAnnotation}, bool)"/> method allows
1502/// other values to compatible/consistent values. For example setting the <see cref="EndpointAnnotation.Protocol"/> property
1503/// of the endpoint annotation in the callback will not automatically change the <see cref="EndpointAnnotation.UriScheme"/>.
1523public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string endpointName, Action<EndpointAnnotation> callback, bool createIfNotExists = true) where T : IResourceWithEndpoints
1529var endpoint = builder.Resource.Annotations
1530.OfType<EndpointAnnotation>()
1596!builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(endpoint => string.Equals(endpoint.Name, endpointName, StringComparisons.EndpointAnnotationName)))
1633var existing = builder.Resource.Annotations.OfType<EndpointAnnotation>()
1666var annotation = new EndpointAnnotation(
1709/// <see cref="EndpointAnnotation.TargetPortEnvironmentVariable"/> is updated
1712private static void ConfigureEndpointEnvironmentVariable<T>(IResourceBuilder<T> builder, EndpointAnnotation endpointAnnotation, string? env) where T : IResourceWithEndpoints
1924if (!builder.Resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints))
1929foreach (var endpoint in endpoints)
Aspire.Hosting.Azure.AppContainers (3)
Aspire.Hosting.Azure.AppService (2)
Aspire.Hosting.Azure.Kusto.Tests (4)
Aspire.Hosting.Azure.Sandboxes (1)
Aspire.Hosting.Azure.Tests (45)
Aspire.Hosting.Blazor (7)
Aspire.Hosting.Blazor.Tests (8)
Aspire.Hosting.Browsers (2)
Aspire.Hosting.Browsers.Tests (2)
Aspire.Hosting.DevTunnels (2)
Aspire.Hosting.Docker (1)
Aspire.Hosting.Dotnet.Tests (7)
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)
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");
Aspire.Hosting.Valkey.Tests (4)
Aspire.Hosting.Yarp.Tests (4)
TestProject.AppHost (2)