12 instantiations of ResourceUrlAnnotation
Aspire.Hosting (2)
ApplicationModel\ResourceUrlAnnotation.cs (1)
43
return
new
()
Orchestrator\ApplicationOrchestrator.cs (1)
173
var url = new
ResourceUrlAnnotation
{ Url = allocatedEndpoint.UriString, Endpoint = new EndpointReference(resourceWithEndpoints, endpoint) };
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)
111
.WithUrls(c => c.Urls.Add(
new
() { Url = "https://example.com", DisplayText = "Example" }));
424
c.Urls.Add(
new
() { Url = "http://example.com/", DisplayLocation = UrlDisplayLocation.SummaryAndDetails });
425
c.Urls.Add(
new
() { Url = "http://example.com/internal", DisplayLocation = UrlDisplayLocation.DetailsOnly });
426
c.Urls.Add(
new
() { Url = "http://example.com/out-of-range", DisplayLocation = (UrlDisplayLocation)100 });
505
return
new
() { Url = "https://example.com" };
564
return
new
() { Url = "/sub-path" };
595
c.Urls.Add(
new
() { Endpoint = c.GetEndpoint("test"), Url = "/sub-path" });
Stress.AppHost (1)
Program.cs (1)
74
.WithUrls(c => c.Urls.Add(
new
() { Url = "https://someplace.com", DisplayText = "Some place" }))
TestShop.AppHost (1)
Program.cs (1)
74
.WithUrlForEndpoint("https", ep =>
new
() { Url = "/health", DisplayText = "Health", DisplayLocation = UrlDisplayLocation.DetailsOnly });
31 references to ResourceUrlAnnotation
Aspire.Hosting (16)
ApplicationModel\ResourceExtensions.cs (1)
494
public static bool TryGetUrls(this IResource resource, [NotNullWhen(true)] out IEnumerable<
ResourceUrlAnnotation
>? urls)
ApplicationModel\ResourceUrlAnnotation.cs (1)
41
internal
ResourceUrlAnnotation
WithEndpoint(EndpointReference endpoint)
ApplicationModel\ResourceUrlsCallbackContext.cs (2)
16
public class ResourceUrlsCallbackContext(DistributedApplicationExecutionContext executionContext, IResource resource, List<
ResourceUrlAnnotation
>? urls = null, CancellationToken cancellationToken = default)
39
public List<
ResourceUrlAnnotation
> Urls { get; } = urls ?? [];
Dcp\ResourceSnapshotBuilder.cs (2)
208
foreach (
var
endpointUrl in urlsForEndpoint)
219
foreach (
var
url in nonEndpointUrls)
Orchestrator\ApplicationOrchestrator.cs (5)
164
var urls = new List<
ResourceUrlAnnotation
>();
173
var
url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = new EndpointReference(resourceWithEndpoints, endpoint) };
198
var
url = existing[i];
204
foreach (
var
url in urls)
216
foreach (
var
url in urls)
ResourceBuilderExtensions.cs (5)
864
/// To add another URL for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Func{EndpointReference,
ResourceUrlAnnotation
})"/>.
891
public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Action<
ResourceUrlAnnotation
> callback)
921
/// To customize the URL that is automatically added for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Action{
ResourceUrlAnnotation
})"/>.
937
public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Func<EndpointReference,
ResourceUrlAnnotation
> callback)
945
var
url = callback(endpoint).WithEndpoint(endpoint);
Aspire.Hosting.Qdrant.Tests (1)
QdrantFunctionalTests.cs (1)
241
var urls = qdrant.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
Aspire.Hosting.Tests (14)
WithUrlsTests.cs (14)
124
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
149
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
175
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
176
var
endpointUrl = urls.First(u => u.Endpoint is not null);
204
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
228
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
252
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
283
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
547
var
endpointUrl = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test");
578
var
endpointUrl = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path"));
609
var
endpointUrl = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path"));