private static void DisplayMatches(string label, ILookupResponse response) { Console.WriteLine($"\n{label}\n"); if (response.IsSuccess) { // Matches foreach (KeyValuePair <string, JObject> match in response.Data.Matches) { Console.WriteLine($"{match.Key} - {match.Value}"); } // Warnings foreach (string warning in response.Data.Warnings) { Console.WriteLine($"WARNING: {warning}"); } } else { Console.WriteLine(response.HttpStatus); } Console.Write("\nHit any key to continue..."); Console.ReadKey(); Console.WriteLine(); }
public static void DisplayTable(string label, ILookupResponse response, int maxCols, int maxRows = 0) { Console.WriteLine($"\n{label}"); if (response.IsSuccess) { if (FormatTable(response.Data.Table, maxCols, maxRows)) { // Warnings if (response.Data.Warnings.Count > 0) { Console.WriteLine($"\n{string.Join(",", response.Data.Warnings.Select(warning => $"{warning}"))}"); } } else { Console.WriteLine($"Response contains an empty data set: {response.Data?.Raw}"); } } else { Console.WriteLine($"IsSuccess: {response.IsSuccess}\n{response.HttpStatus}"); } Console.Write("\nHit <enter> to continue..."); Console.ReadLine(); }
public static void DisplayTable(string label, ILookupResponse response) { DisplayTable(label, response, 0); }