25 references to UrlParameter
Aspire.Hosting (19)
ExternalServiceBuilderExtensions.cs (9)
94else if (resource.UrlParameter is not null) 96resourceBuilder.WithUrl(ReferenceExpression.Create($"{resource.UrlParameter}")); 113url = resource.UrlParameter is null 115: await resource.UrlParameter.GetValueAsync(ct).ConfigureAwait(false); 119e.Logger.LogError(ex, "Failed to get value for URL parameter '{ParameterName}'", resource.UrlParameter?.Name); 131e.Logger.LogError("The value for URL parameter '{ParameterName}' is invalid: {Error}", resource.UrlParameter?.Name, message); 192if (builder.Resource.UrlParameter is null) 213if (builder.Resource.UrlParameter is not null) 219builder.Resource.UrlParameter,
ExternalServiceResource.cs (2)
49/// If <see cref="Uri"/> is <c>null</c>, the external service URL is parameterized and can be accessed via <see cref="UrlParameter"/>."/> 57/// 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 (8)
178else if (externalService.Resource.UrlParameter is not null) 185var url = await externalService.Resource.UrlParameter.GetValueAsync(context.CancellationToken).ConfigureAwait(false); 188throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for the external service '{externalService.Resource.Name}' is invalid: {message}"); 192context.EnvironmentVariables[name] = externalService.Resource.UrlParameter; 534else if (externalService.Resource.UrlParameter is not null) 544else if (ExternalServiceResource.UrlIsValidForExternalService(await externalService.Resource.UrlParameter.GetValueAsync(context.CancellationToken).ConfigureAwait(false), out var uri, out var message)) 550throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for the external service '{externalService.Resource.Name}' is invalid: {message}"); 552context.EnvironmentVariables[envVarName] = externalService.Resource.UrlParameter;
Aspire.Hosting.Tests (4)
ExternalServiceTests.cs (4)
23Assert.Null(externalService.Resource.UrlParameter); 36Assert.Null(externalService.Resource.UrlParameter); 49Assert.NotNull(externalService.Resource.UrlParameter); 50Assert.Equal("nuget-url", externalService.Resource.UrlParameter.Name);
Aspire.Hosting.Yarp (2)
ConfigurationBuilder\YarpCluster.cs (2)
94if (externalService.UrlParameter is not null) 96return externalService.UrlParameter;