26 references to UrlParameter
Aspire.Hosting (20)
ExternalServiceBuilderExtensions.cs (9)
97else if (resource.UrlParameter is not null) 99resourceBuilder.WithUrl(ReferenceExpression.Create($"{resource.UrlParameter}")); 116url = resource.UrlParameter is null 118: await resource.UrlParameter.GetValueAsync(ct).ConfigureAwait(false); 122e.Logger.LogError(ex, "Failed to get value for URL parameter '{ParameterName}'", resource.UrlParameter?.Name); 134e.Logger.LogError("The value for URL parameter '{ParameterName}' is invalid: {Error}", resource.UrlParameter?.Name, message); 196if (builder.Resource.UrlParameter is null) 217if (builder.Resource.UrlParameter is not null) 223builder.Resource.UrlParameter,
ExternalServiceResource.cs (2)
50/// If <see cref="Uri"/> is <c>null</c>, the external service URL is parameterized and can be accessed via <see cref="UrlParameter"/>."/> 58/// If <see cref="UrlParameter"/> is <c>null</c>, the external service URL is not parameterized and can be accessed directly via <see cref="Uri"/>.
ResourceBuilderExtensions.cs (9)
206else if (externalService.Resource.UrlParameter is not null) 213var url = await externalService.Resource.UrlParameter.GetValueAsync(context.CancellationToken).ConfigureAwait(false); 216throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for the external service '{externalService.Resource.Name}' is invalid: {message}"); 220context.EnvironmentVariables[name] = externalService.Resource.UrlParameter; 908else if (externalService.Resource.UrlParameter is not null) 922else if (ExternalServiceResource.UrlIsValidForExternalService(await externalService.Resource.UrlParameter.GetValueAsync(context.CancellationToken).ConfigureAwait(false), out var uri, out var message)) 930throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for the external service '{externalService.Resource.Name}' is invalid: {message}"); 935context.EnvironmentVariables[discoveryEnvVarName] = externalService.Resource.UrlParameter; 940context.EnvironmentVariables[endpointEnvVarName] = externalService.Resource.UrlParameter;
Aspire.Hosting.Tests (4)
ExternalServiceTests.cs (4)
24Assert.Null(externalService.Resource.UrlParameter); 37Assert.Null(externalService.Resource.UrlParameter); 50Assert.NotNull(externalService.Resource.UrlParameter); 51Assert.Equal("nuget-url", externalService.Resource.UrlParameter.Name);
Aspire.Hosting.Yarp (2)
ConfigurationBuilder\YarpCluster.cs (2)
99if (externalService.UrlParameter is not null) 101return externalService.UrlParameter;