20 instantiations of ResourceUrlAnnotation
Aspire.Hosting (7)
ApplicationModel\ResourceUrlAnnotation.cs (1)
43
return
new
()
Orchestrator\ApplicationOrchestrator.cs (4)
237
var url = new
ResourceUrlAnnotation
{ Url = allocatedEndpoint.UriString, Endpoint = endpointReference };
248
EndpointBindingMode.SingleAddress when !allocatedEndpoint.Address.Equals(endpoint.TargetHost, StringComparison.OrdinalIgnoreCase) => new
ResourceUrlAnnotation
257
_ => new
ResourceUrlAnnotation
288
url = new
ResourceUrlAnnotation
ResourceBuilderExtensions.cs (2)
1128
return builder.WithAnnotation(new
ResourceUrlAnnotation
{ Url = url, DisplayText = displayText });
1177
c.Urls.Add(
new
() { Endpoint = endpoint, Url = urlValue, DisplayText = displayText });
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
563
urls.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" }))
663
c.Urls.Add(
new
() { Url = "http://example.com/", DisplayLocation = UrlDisplayLocation.SummaryAndDetails });
664
c.Urls.Add(
new
() { Url = "http://example.com/internal", DisplayLocation = UrlDisplayLocation.DetailsOnly });
665
c.Urls.Add(
new
() { Url = "http://example.com/out-of-range", DisplayLocation = (UrlDisplayLocation)100 });
744
return
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
850
return
new
() { Url = "/sub-path" };
880
c.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)
663
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)
51
public List<
ResourceUrlAnnotation
> Urls { get; } = urls ?? [];
Dashboard\DashboardEventHandlers.cs (1)
435
foreach (
var
url in c.Urls)
Dcp\ResourceSnapshotBuilder.cs (2)
253
foreach (
var
endpointUrl in urlsForEndpoint)
264
foreach (
var
url in nonEndpointUrls)
Orchestrator\ApplicationOrchestrator.cs (8)
214
var urls = new List<
ResourceUrlAnnotation
>();
237
var
url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = endpointReference };
244
var
additionalUrl = allocatedEndpoint.BindingMode switch
326
foreach (
var
staticUrl in staticUrls)
353
var
primaryUrl = urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, primaryLaunchProfileEndpoint.Name, StringComparisons.EndpointAnnotationName));
361
foreach (
var
url in urls)
377
foreach (
var
url in urls)
389
foreach (
var
url in urls)
ProjectResourceBuilderExtensions.cs (1)
611
var
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
})"/>.
1115
foreach (
var
u in c.Urls)
1193
/// To add another URL for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Func{EndpointReference,
ResourceUrlAnnotation
})"/>.
1220
public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Action<
ResourceUrlAnnotation
> callback)
1225
var
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
})"/>.
1266
public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Func<EndpointReference,
ResourceUrlAnnotation
> callback)
1274
var
url = callback(endpoint).WithEndpoint(endpoint);
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
358
var
url = context.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == KnownUrls.DataExplorer.EndpointName);
Aspire.Hosting.Qdrant.Tests (1)
QdrantFunctionalTests.cs (1)
242
var urls = qdrant.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
Aspire.Hosting.Tests (24)
DistributedApplicationTests.cs (1)
1080
var dashboardUrls = aspireDashboard.Annotations.OfType<
ResourceUrlAnnotation
>().ToList();
WithEndpointTests.cs (2)
620
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
654
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
WithUrlsTests.cs (21)
152
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
176
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
202
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
203
var
endpointUrl = urls.First(u => u.Endpoint is not null);
230
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
263
var urls = projectB.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
306
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
329
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
359
var urls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
784
var allUrls = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>();
785
var
endpointUrl = allUrls.FirstOrDefault(u => u.Endpoint?.EndpointName == "test");
786
var
staticBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-before.com"));
787
var
callbackBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-before.com"));
788
var
staticAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-after.com"));
789
var
callbackAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-after.com"));
832
var
endpointUrl = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test");
862
var
endpointUrl = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path"));
892
var
endpointUrl = projectA.Resource.Annotations.OfType<
ResourceUrlAnnotation
>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path"));