Until I can get better documentation, see the samples project for examples.
services.AddHttpClient<ScryfallApiClient>(client =>
{
client.BaseAddress = new Uri("https://api.scryfall.com/");
});
ScryfallApiClient _scryfallApi { get; }
public IndexModel(ScryfallApiClient scryfallApi)
{
_scryfallApi = scryfallApi ?? throw new ArgumentNullException(nameof(scryfallApi));
}
var randomCard = await _scryfallApi.Cards.GetRandom();