I have a blazor server web app and multiple API's. Each of those api's lead to a different location.I currently change the location to where it needs to go based on a parameter that i then pass along to every function like so:
public class ActiviteitenClient(HttpClient httpClient) { private readonly HttpClient _httpClient = httpClient; public async Task<List<OActiviteit>> GetAsync(string adres = "") { _httpClient.BaseAddress = new(adres); var y = await _httpClient.GetAsync($"/api/Activiteit"); var z = JsonSerializer.Deserialize<List<OActiviteit>>(await y.Content.ReadAsStringAsync()); return z; }...there has to be a better way to do this. Can anyone enlighten me how?