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