Example #1
0
        static void GetBaseUrl()
        {
            Prompt baseUrlPrompt = new Prompt("enter base url:", new string[0]);

            baseUrlPrompt.Answered += (sender, e) => {
                try {
                    Uri uri = new Uri(e.answer);

                    AdminClient adminClient = new AdminClient(uri.ToString());
                    Console.WriteLine("Login as Admin:");
                    adminClient.Login(new Prompt("Username:"******"Password:").Execute()).Wait();
                    CreateCustomer(adminClient);
                } catch (UriFormatException) {
                    e.invalid = true;
                }
            };
            baseUrlPrompt.Execute();
        }