16 instantiations of ResourceUrlAnnotation
Aspire.Hosting (6)
ApplicationModel\ResourceUrlAnnotation.cs (1)
43return new()
Orchestrator\ApplicationOrchestrator.cs (3)
219var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = endpointReference }; 232EndpointBindingMode.SingleAddress when !allocatedEndpoint.Address.Equals(endpoint.TargetHost, StringComparison.OrdinalIgnoreCase) => new ResourceUrlAnnotation 241_ => new ResourceUrlAnnotation
ResourceBuilderExtensions.cs (2)
934return builder.WithAnnotation(new ResourceUrlAnnotation { Url = url, DisplayText = displayText }); 983c.Urls.Add(new() { Endpoint = endpoint, Url = urlValue, DisplayText = displayText });
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
97.WithUrlForEndpoint(QdrantServerResource.HttpEndpointName, e => new ResourceUrlAnnotation() { Url = "/dashboard", DisplayText = "Qdrant Dashboard" });
Aspire.Hosting.Tests (7)
WithUrlsTests.cs (7)
140.WithUrls(c => c.Urls.Add(new() { Url = "https://example.com", DisplayText = "Example" })) 609c.Urls.Add(new() { Url = "http://example.com/", DisplayLocation = UrlDisplayLocation.SummaryAndDetails }); 610c.Urls.Add(new() { Url = "http://example.com/internal", DisplayLocation = UrlDisplayLocation.DetailsOnly }); 611c.Urls.Add(new() { Url = "http://example.com/out-of-range", DisplayLocation = (UrlDisplayLocation)100 }); 690return new() { Url = "https://example.com" }; 747return new() { Url = "/sub-path" }; 777c.Urls.Add(new() { Endpoint = c.GetEndpoint("test"), Url = "/sub-path" });
Stress.AppHost (1)
Program.cs (1)
90.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 })
37 references to ResourceUrlAnnotation
Aspire.Hosting (19)
ApplicationModel\ResourceExtensions.cs (1)
501public 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) 39public List<ResourceUrlAnnotation> Urls { get; } = urls ?? [];
Dcp\ResourceSnapshotBuilder.cs (2)
253foreach (var endpointUrl in urlsForEndpoint) 264foreach (var url in nonEndpointUrls)
Orchestrator\ApplicationOrchestrator.cs (6)
202var urls = new List<ResourceUrlAnnotation>(); 219var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = endpointReference }; 228var additionalUrl = allocatedEndpoint.BindingMode switch 270foreach (var url in urls) 283foreach (var existingUrl in existingUrls) 296foreach (var url in urls)
ProjectResourceBuilderExtensions.cs (1)
474var url = context.Urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, endpoint.Name, StringComparisons.EndpointAnnotationName));
ResourceBuilderExtensions.cs (6)
999/// To add another URL for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Func{EndpointReference, ResourceUrlAnnotation})"/>. 1026public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Action<ResourceUrlAnnotation> callback) 1031var urlForEndpoint = context.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == endpointName); 1056/// To customize the URL that is automatically added for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Action{ResourceUrlAnnotation})"/>. 1072public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Func<EndpointReference, ResourceUrlAnnotation> callback) 1080var 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 (16)
WithEndpointTests.cs (2)
638var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 672var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>();
WithUrlsTests.cs (14)
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>(); 252var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 275var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 305var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 729var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test"); 759var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 789var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path"));