示例#1
0
        private void CheckoutBook()
        {
            PrintBooks();
            var books = _lp.GetBooks(_libraryId);

            Console.WriteLine("What book would you likek to check out?");
            string input = Console.ReadLine();
            int    index = -1;
            bool   valid = int.TryParse(input, out index);

            if (!valid || index <= 0 || index > books.Count)
            {
                Console.WriteLine("Please make a valid selection");
            }
            Console.WriteLine(_lp.CheckOutBook(_libraryId, books[index - 1].Id));
        }