25 instantiations of ResourceUrlAnnotation
Aspire.Hosting (7)
ApplicationModel\ResourceUrlAnnotation.cs (1)
44
return
new
()
Orchestrator\ApplicationOrchestrator.cs (4)
248
var url = new
ResourceUrlAnnotation
{ Url = allocatedEndpoint.UriString, Endpoint = endpointReference };
259
EndpointBindingMode.SingleAddress when !allocatedEndpoint.Address.Equals(endpoint.TargetHost, StringComparison.OrdinalIgnoreCase) => new
ResourceUrlAnnotation
268
_ => new
ResourceUrlAnnotation
300
url = new
ResourceUrlAnnotation
ResourceBuilderExtensions.cs (2)
1238
return builder.WithAnnotation(new
ResourceUrlAnnotation
{ Url = url, DisplayText = displayText });
1288
c.Urls.Add(
new
() { Endpoint = endpoint, Url = urlValue, DisplayText = displayText });
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
603
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 (13)
Dashboard\DashboardResourceTests.cs (2)
667
new
() { Url = "http://localhost:5003", Endpoint = ((IResourceWithEndpoints)dashboard).GetEndpoint("http") },
668
new
() { Url = "https://localhost:5005", Endpoint = ((IResourceWithEndpoints)dashboard).GetEndpoint("https") }
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 })
56 references to ResourceUrlAnnotation
Aspire.Hosting (26)
ApplicationModel\ResourceExtensions.cs (1)
656
public static bool TryGetUrls(this IResource resource, [NotNullWhen(true)] out IEnumerable<
ResourceUrlAnnotation
>? urls)
ApplicationModel\ResourceUrlAnnotation.cs (1)
42
internal
ResourceUrlAnnotation
WithEndpoint(EndpointReference endpoint)
ApplicationModel\ResourceUrlsCallbackContext.cs (2)
17
public class ResourceUrlsCallbackContext(DistributedApplicationExecutionContext executionContext, IResource resource, List<
ResourceUrlAnnotation
>? urls = null, CancellationToken cancellationToken = default)
52
public List<
ResourceUrlAnnotation
> Urls { get; } = urls ?? [];
Dashboard\DashboardEventHandlers.cs (1)
453
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)
216
var urls = new List<
ResourceUrlAnnotation
>();
248
var
url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = endpointReference };
255
var
additionalUrl = allocatedEndpoint.BindingMode switch
345
foreach (
var
staticUrl in staticUrls)
394
var
primaryUrl = urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, primaryLaunchProfileEndpoint.Name, StringComparisons.EndpointAnnotationName));
407
foreach (
var
url in urls)
448
foreach (
var
url in urls)
465
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)
1197
/// To modify the URL for a specific endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Action{
ResourceUrlAnnotation
})"/>.
1225
foreach (
var
u in c.Urls)
1304
/// To add another URL for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Func{EndpointReference,
ResourceUrlAnnotation
})"/>.
1332
public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Action<
ResourceUrlAnnotation
> callback)
1337
var
urlForEndpoint = context.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == endpointName);
1362
/// To customize the URL that is automatically added for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Action{
ResourceUrlAnnotation
})"/>.
1379
public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Func<EndpointReference,
ResourceUrlAnnotation
> callback)
1387
var
url = callback(endpoint).WithEndpoint(endpoint);
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
371
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 (28)
Dashboard\DashboardResourceTests.cs (3)
665
var urls = new List<
ResourceUrlAnnotation
>
679
var
httpUrl = urls.FirstOrDefault(u => u.Endpoint?.EndpointName == "http");
680
var
httpsUrl = urls.FirstOrDefault(u => u.Endpoint?.EndpointName == "https");
DistributedApplicationTests.cs (1)
1210
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"));