23 instantiations of ResourceUrlAnnotation
Aspire.Hosting (7)
ApplicationModel\ResourceUrlAnnotation.cs (1)
43return new()
Orchestrator\ApplicationOrchestrator.cs (4)
250var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = endpointReference }; 261EndpointBindingMode.SingleAddress when !allocatedEndpoint.Address.Equals(endpoint.TargetHost, StringComparison.OrdinalIgnoreCase) => new ResourceUrlAnnotation 270_ => new ResourceUrlAnnotation 302url = new ResourceUrlAnnotation
ResourceBuilderExtensions.cs (2)
1186return builder.WithAnnotation(new ResourceUrlAnnotation { Url = url, DisplayText = displayText }); 1235c.Urls.Add(new() { Endpoint = endpoint, Url = urlValue, DisplayText = displayText });
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
566urls.Add(new()
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
97.WithUrlForEndpoint(QdrantServerResource.HttpEndpointName, e => new ResourceUrlAnnotation() { Url = "/dashboard", DisplayText = "Qdrant Dashboard" });
Aspire.Hosting.Tests (11)
WithUrlsTests.cs (11)
140.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 }); 730return new() { Url = "https://example.com" }; 756.WithUrls(c => c.Urls.Add(new() { Url = "https://callback-before.com/sub-path", DisplayText = "Example" })) 759.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 855.WithUrlForEndpoint("http", _ => new() 899return new() { Url = "/sub-path" }; 929c.Urls.Add(new() { Endpoint = c.GetEndpoint("test"), Url = "/sub-path" }); 963c.Urls.Add(new()
Stress.AppHost (1)
Program.cs (1)
98.WithUrls(c => c.Urls.Add(new() { Url = "https://someplace.com", DisplayText = "Some place" }))
TestShop.AppHost (2)
AppHost.cs (2)
61.WithUrlForEndpoint("https", _ => new() 89.WithUrlForEndpoint("https", ep => new() { Url = "/health", DisplayText = "Health", DisplayLocation = UrlDisplayLocation.DetailsOnly })
53 references to ResourceUrlAnnotation
Aspire.Hosting (26)
ApplicationModel\ResourceExtensions.cs (1)
654public 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)
438foreach (var url in c.Urls)
Dcp\ResourceSnapshotBuilder.cs (4)
254var processedEndpointUrls = new HashSet<ResourceUrlAnnotation>(); 264foreach (var endpointUrl in urlsForEndpoint) 288foreach (var endpointUrl in crossResourceEndpointUrls) 310foreach (var url in nonEndpointUrls)
Orchestrator\ApplicationOrchestrator.cs (8)
218var urls = new List<ResourceUrlAnnotation>(); 250var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = endpointReference }; 257var additionalUrl = allocatedEndpoint.BindingMode switch 347foreach (var staticUrl in staticUrls) 396var primaryUrl = urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, primaryLaunchProfileEndpoint.Name, StringComparisons.EndpointAnnotationName)); 409foreach (var url in urls) 450foreach (var url in urls) 467foreach (var url in urls)
ProjectResourceBuilderExtensions.cs (1)
607var url = context.Urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, endpoint.Name, StringComparisons.EndpointAnnotationName));
ResourceBuilderExtensions.cs (8)
1146/// To modify the URL for a specific endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Action{ResourceUrlAnnotation})"/>. 1173foreach (var u in c.Urls) 1251/// To add another URL for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Func{EndpointReference, ResourceUrlAnnotation})"/>. 1278public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Action<ResourceUrlAnnotation> callback) 1283var urlForEndpoint = context.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == endpointName); 1308/// To customize the URL that is automatically added for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Action{ResourceUrlAnnotation})"/>. 1324public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Func<EndpointReference, ResourceUrlAnnotation> callback) 1332var url = callback(endpoint).WithEndpoint(endpoint);
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
369var url = context.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == KnownUrls.DataExplorer.EndpointName);
Aspire.Hosting.Qdrant.Tests (1)
QdrantFunctionalTests.cs (1)
245var urls = qdrant.Resource.Annotations.OfType<ResourceUrlAnnotation>();
Aspire.Hosting.Tests (25)
DistributedApplicationTests.cs (1)
1213var dashboardUrls = aspireDashboard.Annotations.OfType<ResourceUrlAnnotation>().ToList();
WithEndpointTests.cs (2)
616var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 650var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>();
WithUrlsTests.cs (22)
151var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 175var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 201var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 202var endpointUrl = urls.First(u => u.Endpoint is not null); 229var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 262var urls = projectB.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 305var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 328var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 358var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 770var allUrls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 771var endpointUrl = allUrls.FirstOrDefault(u => u.Endpoint?.EndpointName == "test"); 772var staticBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-before.com")); 773var callbackBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-before.com")); 774var staticAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-after.com")); 775var callbackAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-after.com")); 831var endpointUrl = project.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test"); 870var launchProfileUrls = project.Resource.Annotations.OfType<ResourceUrlAnnotation>().Where(u => u.Endpoint?.EndpointName == "http"); 911var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 941var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path"));