Код: Выделить всё
namespace AspireApp1.Web;
public class WeatherApiClient(HttpClient httpClient)
{
public Uri? BaseAddress => httpClient.BaseAddress;
/* Other implementation... */
}
Код: Выделить всё
@page "/"
@inject WeatherApiClient MyWeatherApiClient
Home
Hello, world!
Welcome to your new app.
@MyWeatherApiClient.BaseAddress
Подробнее здесь: https://stackoverflow.com/questions/794 ... -correctly