20 instantiations of ResourceUrlAnnotation
Aspire.Hosting (7)
ApplicationModel\ResourceUrlAnnotation.cs (1)
43return new()
Orchestrator\ApplicationOrchestrator.cs (4)
237var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = endpointReference }; 248EndpointBindingMode.SingleAddress when !allocatedEndpoint.Address.Equals(endpoint.TargetHost, StringComparison.OrdinalIgnoreCase) => new ResourceUrlAnnotation 257_ => new ResourceUrlAnnotation 288url = new ResourceUrlAnnotation
ResourceBuilderExtensions.cs (2)
1128return builder.WithAnnotation(new ResourceUrlAnnotation { Url = url, DisplayText = displayText }); 1177c.Urls.Add(new() { Endpoint = endpoint, Url = urlValue, DisplayText = displayText });
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
563urls.Add(new()
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
97.WithUrlForEndpoint(QdrantServerResource.HttpEndpointName, e => new ResourceUrlAnnotation() { Url = "/dashboard", DisplayText = "Qdrant Dashboard" });
Aspire.Hosting.Tests (9)
WithUrlsTests.cs (9)
141.WithUrls(c => c.Urls.Add(new() { Url = "https://example.com", DisplayText = "Example" })) 663c.Urls.Add(new() { Url = "http://example.com/", DisplayLocation = UrlDisplayLocation.SummaryAndDetails }); 664c.Urls.Add(new() { Url = "http://example.com/internal", DisplayLocation = UrlDisplayLocation.DetailsOnly }); 665c.Urls.Add(new() { Url = "http://example.com/out-of-range", DisplayLocation = (UrlDisplayLocation)100 }); 744return new() { Url = "https://example.com" }; 770.WithUrls(c => c.Urls.Add(new() { Url = "https://callback-before.com/sub-path", DisplayText = "Example" })) 773.WithUrls(c => c.Urls.Add(new() { Url = "https://callback-after.com/sub-path" })) // This won't get updated because it's added after the relative URL 850return new() { Url = "/sub-path" }; 880c.Urls.Add(new() { Endpoint = c.GetEndpoint("test"), Url = "/sub-path" });
Stress.AppHost (1)
Program.cs (1)
98.WithUrls(c => c.Urls.Add(new() { Url = "https://someplace.com", DisplayText = "Some place" }))
TestShop.AppHost (1)
Program.cs (1)
75.WithUrlForEndpoint("https", ep => new() { Url = "/health", DisplayText = "Health", DisplayLocation = UrlDisplayLocation.DetailsOnly })
50 references to ResourceUrlAnnotation
Aspire.Hosting (24)
ApplicationModel\ResourceExtensions.cs (1)
663public static bool TryGetUrls(this IResource resource, [NotNullWhen(true)] out IEnumerable<ResourceUrlAnnotation>? urls)
ApplicationModel\ResourceUrlAnnotation.cs (1)
41internal ResourceUrlAnnotation WithEndpoint(EndpointReference endpoint)
ApplicationModel\ResourceUrlsCallbackContext.cs (2)
16public class ResourceUrlsCallbackContext(DistributedApplicationExecutionContext executionContext, IResource resource, List<ResourceUrlAnnotation>? urls = null, CancellationToken cancellationToken = default) 51public List<ResourceUrlAnnotation> Urls { get; } = urls ?? [];
Dashboard\DashboardEventHandlers.cs (1)
435foreach (var url in c.Urls)
Dcp\ResourceSnapshotBuilder.cs (2)
253foreach (var endpointUrl in urlsForEndpoint) 264foreach (var url in nonEndpointUrls)
Orchestrator\ApplicationOrchestrator.cs (8)
214var urls = new List<ResourceUrlAnnotation>(); 237var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = endpointReference }; 244var additionalUrl = allocatedEndpoint.BindingMode switch 326foreach (var staticUrl in staticUrls) 353var primaryUrl = urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, primaryLaunchProfileEndpoint.Name, StringComparisons.EndpointAnnotationName)); 361foreach (var url in urls) 377foreach (var url in urls) 389foreach (var url in urls)
ProjectResourceBuilderExtensions.cs (1)
611var url = context.Urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, endpoint.Name, StringComparisons.EndpointAnnotationName));
ResourceBuilderExtensions.cs (8)
1088/// To modify the URL for a specific endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Action{ResourceUrlAnnotation})"/>. 1115foreach (var u in c.Urls) 1193/// To add another URL for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Func{EndpointReference, ResourceUrlAnnotation})"/>. 1220public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Action<ResourceUrlAnnotation> callback) 1225var urlForEndpoint = context.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == endpointName); 1250/// To customize the URL that is automatically added for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Action{ResourceUrlAnnotation})"/>. 1266public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Func<EndpointReference, ResourceUrlAnnotation> callback) 1274var url = callback(endpoint).WithEndpoint(endpoint);
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
358var url = context.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == KnownUrls.DataExplorer.EndpointName);
Aspire.Hosting.Qdrant.Tests (1)
QdrantFunctionalTests.cs (1)
242var urls = qdrant.Resource.Annotations.OfType<ResourceUrlAnnotation>();
Aspire.Hosting.Tests (24)
DistributedApplicationTests.cs (1)
1080var dashboardUrls = aspireDashboard.Annotations.OfType<ResourceUrlAnnotation>().ToList();
WithEndpointTests.cs (2)
620var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 654var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>();
WithUrlsTests.cs (21)
152var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 176var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 202var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 203var endpointUrl = urls.First(u => u.Endpoint is not null); 230var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 263var urls = projectB.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 306var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 329var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 359var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 784var allUrls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 785var endpointUrl = allUrls.FirstOrDefault(u => u.Endpoint?.EndpointName == "test"); 786var staticBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-before.com")); 787var callbackBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-before.com")); 788var staticAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-after.com")); 789var callbackAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-after.com")); 832var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test"); 862var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 892var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path"));