This package is auto-geneated from the Scryfall API definition.
- Create a folder for your project
mkdir MyProject
cd MyProject
git init- Create the project, and add dependencies
dotnet new console
dotnet add package Microsoft.Rest.ClientRuntime --version 2.3.11- Add this repository as a submodule.
git submodule add https://github.com/jdharmon/scryfallapi-csharp.git Scryfall- Open Program.cs, and add
using Scryfall.API;- Instantiate and use ScryfallClient:
static void Main(string[] args)
{
// Instiantiate new Scryfall client
var scryfall = new ScryfallClient();
// Get a random card
var card = scryfall.Cards.GetRandom();
Console.WriteLine($"{card.Name}\t\t{card.ManaCost}\n");
Console.WriteLine($"{card.TypeLine}\n");
Console.WriteLine($"{card.OracleText}");
}- Build & run
dotnet build
dotnet run