21 references to UrlParameter
Aspire.Hosting (15)
ExternalServiceBuilderExtensions.cs (5)
91else if (resource.UrlParameter is not null) 93resourceBuilder.WithUrl(ReferenceExpression.Create($"{resource.UrlParameter}")); 107var url = resource.UrlParameter?.Value; 111e.Logger.LogError("The value for URL parameter '{ParameterName}' is invalid: {Error}", resource.UrlParameter?.Name, message); 185if (uri is null && !Uri.TryCreate(builder.Resource.UrlParameter?.Value, UriKind.Absolute, out uri)
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) 183if (!context.ExecutionContext.IsPublishMode && !ExternalServiceResource.UrlIsValidForExternalService(externalService.Resource.UrlParameter.Value, out var _, out var message)) 185throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for the external service '{externalService.Resource.Name}' is invalid: {message}"); 187context.EnvironmentVariables[name] = externalService.Resource.UrlParameter; 529else if (externalService.Resource.UrlParameter is not null) 539else if (ExternalServiceResource.UrlIsValidForExternalService(externalService.Resource.UrlParameter.Value, out var uri, out var message)) 545throw new DistributedApplicationException($"The URL parameter '{externalService.Resource.UrlParameter.Name}' for the external service '{externalService.Resource.Name}' is invalid: {message}"); 547context.EnvironmentVariables[envVarName] = externalService.Resource.UrlParameter;
Aspire.Hosting.Tests (4)
ExternalServiceTests.cs (4)
22Assert.Null(externalService.Resource.UrlParameter); 35Assert.Null(externalService.Resource.UrlParameter); 48Assert.NotNull(externalService.Resource.UrlParameter); 49Assert.Equal("nuget-url", externalService.Resource.UrlParameter.Name);
Aspire.Hosting.Yarp (2)
ConfigurationBuilder\YarpCluster.cs (2)
87if (externalService.UrlParameter is not null) 90return externalService.UrlParameter.Value;