static void Main(string[] args) { _service = new QuibbleDataService(); string input = ""; while (input.ToUpper() != "Q") { Console.WriteLine("---------------"); Console.WriteLine("L) List quibbles"); Console.WriteLine("#) Query specific quibble"); Console.WriteLine("N) Enter a new quibble"); Console.WriteLine("Q) Quit"); Console.Write("Please enter a command: "); input = Console.ReadLine().ToUpper(); int index = 0; if (input == "L") { List(); } else if (input == "N") { Enter(); } else if (Int32.TryParse(input, out index)) { Query(index); } } }
public QuibbleModule() : base("/quibbles") { _service = new QuibbleDataService(); Get["/"] = arguments => GetQuibbles(); Get["/{id}"] = arguments => GetQuibbleById(arguments.id); Post["/"] = arguments => CreateQuibble(); Put["/{id}"] = arguments => UpdateQuibble(arguments.id); Delete["/{id}"] = arguments => DeleteQuibble(arguments.id); }
public Service() { _service = new QuibbleDataService(); }