14 instantiations of ResourceUrlAnnotation
Aspire.Hosting (4)
ApplicationModel\ResourceUrlAnnotation.cs (1)
43return new()
Orchestrator\ApplicationOrchestrator.cs (1)
215var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = new EndpointReference(resourceWithEndpoints, endpoint) };
ResourceBuilderExtensions.cs (2)
929return builder.WithAnnotation(new ResourceUrlAnnotation { Url = url, DisplayText = displayText }); 978c.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)
141.WithUrls(c => c.Urls.Add(new() { Url = "https://example.com", DisplayText = "Example" })) 564c.Urls.Add(new() { Url = "http://example.com/", DisplayLocation = UrlDisplayLocation.SummaryAndDetails }); 565c.Urls.Add(new() { Url = "http://example.com/internal", DisplayLocation = UrlDisplayLocation.DetailsOnly }); 566c.Urls.Add(new() { Url = "http://example.com/out-of-range", DisplayLocation = (UrlDisplayLocation)100 }); 645return new() { Url = "https://example.com" }; 702return new() { Url = "/sub-path" }; 732c.Urls.Add(new() { Endpoint = c.GetEndpoint("test"), Url = "/sub-path" });
Stress.AppHost (1)
Program.cs (1)
88.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 })
34 references to ResourceUrlAnnotation
Aspire.Hosting (18)
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)
213foreach (var endpointUrl in urlsForEndpoint) 224foreach (var url in nonEndpointUrls)
Orchestrator\ApplicationOrchestrator.cs (5)
204var urls = new List<ResourceUrlAnnotation>(); 215var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = new EndpointReference(resourceWithEndpoints, endpoint) }; 246var url = existing[i]; 252foreach (var url in urls) 264foreach (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)
994/// To add another URL for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Func{EndpointReference, ResourceUrlAnnotation})"/>. 1021public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Action<ResourceUrlAnnotation> callback) 1026var urlForEndpoint = context.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == endpointName); 1051/// To customize the URL that is automatically added for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Action{ResourceUrlAnnotation})"/>. 1067public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Func<EndpointReference, ResourceUrlAnnotation> callback) 1075var url = callback(endpoint).WithEndpoint(endpoint);
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
355var url = context.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == KnownUrls.DataExplorer.EndpointName);
Aspire.Hosting.Qdrant.Tests (1)
QdrantFunctionalTests.cs (1)
243var urls = qdrant.Resource.Annotations.OfType<ResourceUrlAnnotation>();
Aspire.Hosting.Tests (14)
WithUrlsTests.cs (14)
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>(); 253var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 276var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 306var urls = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>(); 684var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test"); 714var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 744var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path"));