28 references to UrlParameter
Aspire.Hosting (22)
ExternalServiceBuilderExtensions.cs (11)
118else if (resource.UrlParameter is not null) 120resourceBuilder.WithUrl(ReferenceExpression.Create($"{resource.UrlParameter}")); 137url = resource.UrlParameter is null 139: await resource.UrlParameter.GetValueAsync(ct).ConfigureAwait(false); 143e.Logger.LogError(ex, "Failed to get value for URL parameter '{ParameterName}'", resource.UrlParameter?.Name); 155e.Logger.LogError("The value for URL parameter '{ParameterName}' is invalid: {Error}", resource.UrlParameter?.Name, message); 213/// When the URL comes from a <see cref="ExternalServiceResource.UrlParameter"/>, the final address is not known at 227if (builder.Resource.UrlParameter is null) 239Debug.Assert(builder.Resource.Uri is not null || builder.Resource.UrlParameter is not null, "Either Uri or UrlParameter must be provided."); 250if (builder.Resource.UrlParameter is not null) 256builder.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)
437else if (externalService.Resource.UrlParameter is not null) 444var url = await externalService.Resource.UrlParameter.GetValueAsync(context.CancellationToken).ConfigureAwait(false); 447throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for source resource '{externalService.Resource.Name}' is invalid while configuring target resource '{builder.Resource.Name}': {message}"); 451context.EnvironmentVariables[name] = externalService.Resource.UrlParameter; 1330else if (externalService.Resource.UrlParameter is not null) 1344else if (ExternalServiceResource.UrlIsValidForExternalService(await externalService.Resource.UrlParameter.GetValueAsync(context.CancellationToken).ConfigureAwait(false), out var uri, out var message)) 1352throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for source resource '{externalService.Resource.Name}' is invalid while configuring target resource '{builder.Resource.Name}': {message}"); 1357context.EnvironmentVariables[discoveryEnvVarName] = externalService.Resource.UrlParameter; 1362context.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)
165if (externalService.UrlParameter is not null) 167return externalService.UrlParameter;