private static void E2ETester(string input, StorageCredentials creds) { Console.WriteLine("{0}", input); IEnumerable <DynamicTableEntity> results = AzSQL.RunQuery(input, creds); AzTableQuery.RenderResults(results); Console.WriteLine("----------------------"); Console.WriteLine(); }
private static void repl() // R-E-P-Loop { StorageCredentials creds = new StorageCredentials(acctName, acctKey); string input; string prompt = "> "; Console.Write("{0}", prompt); input = Console.ReadLine(); while (input.ToLower() != "quit" && input.ToLower() != "exit") { if (input.Trim() != "") { try { IEnumerable <DynamicTableEntity> results = AzSQL.RunQuery(input, creds); AzTableQuery.RenderResults(results); } catch (AzSQLParseException ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Syntax Eror at line {0}, position {1}: {2}", ex.line, ex.charPosition, ex.Message); Console.ResetColor(); } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Exception {0}: {1}", ex.GetType().FullName, ex.Message); Console.ResetColor(); } finally { Console.WriteLine(); } } Console.Write("{0}", prompt); input = Console.ReadLine(); } }