BlueManiac / Scryfall-API-Client

This is a .NET client library for accessing the scryfall.com API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scryfall API Client

Build status

Getting Started

Until I can get better documentation, see the samples project for examples.


.NET Core Instructions

Add a service definition to your startup.cs file's ConfigureServices method.

services.AddHttpClient<ScryfallApiClient>(client =>
{
    client.BaseAddress = new Uri("https://api.scryfall.com/");
});

Add a ScryfallApiClient parameter and member to your Controller or Razor Page

ScryfallApiClient _scryfallApi { get; }

public IndexModel(ScryfallApiClient scryfallApi)
{
    _scryfallApi = scryfallApi ?? throw new ArgumentNullException(nameof(scryfallApi));
}

Use the client

var randomCard = await _scryfallApi.Cards.GetRandom();

About

This is a .NET client library for accessing the scryfall.com API

License:MIT License


Languages

Language:C# 100.0%