Esempio n. 1
0
        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);
                }
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public Service()
 {
     _service = new QuibbleDataService();
 }