VisualBean
4/14/2016 - 11:35 AM

Program.cs

using System;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace SwaggerClientTest
{
    class Program
    {
        static void Main(string[] args)
        {
            //Create a new instance
            var clientConfig = new Configuration();
            //Add the key to the Authorization header
            clientConfig.ApiKey["api_key"] = "special-key";

            //Pass the config through the api ctor
            var storeApi = new StoreApi(clientConfig);
            //Call the Api
            var inventory = storeApi.GetInventory();
            foreach (var type in inventory)
            {
                Console.WriteLine(type.Key + ": "+ type.Value);
            }           

            Console.ReadKey();
        }
    }
}