Get dataset list using C#

Using sync call on async method in console line application using Slamby .Net SDK v0.17.0.

.Net SDK is available in Nuget Galery.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Slamby.SDK.Net.Managers;
using Slamby.SDK.Net;
using Slamby.SDK.Net.Models;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            var configuration = new Configuration
            {
                ApiBaseEndpoint = new Uri("https://europe.slamby.com/demo/"),
                ApiSecret = "s3cr3t"
            };
            var manager = new DataSetManager(configuration);
            var response = manager.GetDataSetsAsync().GetAwaiter().GetResult();
            foreach (var item in response.ResponseObject)
            {
                Console.WriteLine(item.Name);
            }
            Console.ReadLine();
        }
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *