static void Main(string[] args) { _service = new PunDataService(); string input = ""; while (input.ToUpper() != "Q") { Console.WriteLine("---------------"); Console.WriteLine("L) List puns"); Console.WriteLine("#) Show specific pun"); Console.WriteLine("N) Enter a new pun"); Console.WriteLine("Q) Quit"); Console.Write("Please enter a command: "); input = Console.ReadLine().ToUpper(); int index = 0; if (input == "L") { ListPuns(); } else if (input == "N") { EnterPun(); } else if (Int32.TryParse(input, out index)) { ShowPun(index); } } }
public PunService() { _service = new PunDataService(); }
public Pun[] GetPuns() { var service = new PunDataService(); return(service.GetPuns()); }