Exemplo n.º 1
0
        static async Task TestTagsAsync()
        {
            Console.WriteLine("Testing Tags:");

            Console.WriteLine("Fetching available tags:");
            var listTags = await _client.GetTagsAsync();

            Console.WriteLine($"received a total number of {listTags.Value.Count} TagInfos.");

            Console.ReadLine();

            Console.WriteLine("selecting a random tag from reveived tags list ...");

            var rnd      = new Random();
            var selected = rnd.Next(listTags.Value.Count - 1);

            var tagId = listTags.Value.ElementAt(selected).Id;

            Console.WriteLine($"Fetching info for tag: {tagId}");

            var tagById = await _client.GetTagByIdAsync(tagId);

            Console.WriteLine($"TagInfo: {tagById.Value.Name} ({tagById.Value.Type}) - {tagById.Value.Description}");

            Console.ReadLine();
            Console.WriteLine("Bye!");
        }