static void Main(string[] args) { var service = new ServiceFactory <TransactionService>().CreateTransaction(); var cmd = ShowCommand(); do { switch (cmd.ToLower()) { case "add": service.Add(); cmd = ShowCommand(); break; case "get": service.Get(); cmd = ShowCommand(); break; case "exit": Exit(); break; } } while (!string.Equals(cmd, null, StringComparison.Ordinal) && cmd != "exit"); }