Esempio n. 1
0
            public Task getAuthorNames(HttpContext context)
            {
                bookController bookC = new bookController();
                var            book  = bookC.searchBook();

                return(context.Response.WriteAsync(book[0].getAuthorNames()));
            }
Esempio n. 2
0
            public Task resultToString(HttpContext context)
            {
                bookController bookC = new bookController();
                var            book  = bookC.searchBook();

                return(context.Response.WriteAsync(book[0].ToString()));
            }
Esempio n. 3
0
            public Task NameBook(HttpContext context)
            {
                bookController bookC = new bookController();
                var            book  = bookC.searchBook();

                return(context.Response.WriteAsync(book[0].name));
            }
Esempio n. 4
0
            public Task sendHTML(HttpContext context)
            {
                bookController bookC = new bookController();
                var            book  = bookC.searchBook();
                var            html  = $"<pre style='color:blue'>{book[0].ToString()}</pre>";

                return(context.Response.WriteAsync(html));
            }
Esempio n. 5
0
 public void readBookCsv()
 {
     try{
         bookController bookC = new bookController();
         var            Books = bookC.searchBook();
         Console.WriteLine("Success");
     }
     catch (IOException e) {
         Console.WriteLine("Failed");
         throw;
     }
 }
Esempio n. 6
0
        public void viewBooks()
        {
            try
            {
                Console.WriteLine("Success");

                bookController bookC = new bookController();
                var            Books = bookC.searchBook();

                Console.WriteLine("Success");

                foreach (var book in Books)
                {
                    Console.WriteLine($"   book ToString ");
                    Console.WriteLine(book.ToString());
                    Console.WriteLine($"   getAuthorNames | {book.getAuthorNames()}");
                }
            }
            catch (IOException e)
            {
                Console.WriteLine("Failed");
                throw;
            }
        }