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

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

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

                return(context.Response.WriteAsync(book[0].name));
            }
Exemple #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));
            }
Exemple #5
0
 public void readBookCsv()
 {
     try{
         bookController bookC = new bookController();
         var            Books = bookC.searchBook();
         Console.WriteLine("Success");
     }
     catch (IOException e) {
         Console.WriteLine("Failed");
         throw;
     }
 }
Exemple #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;
            }
        }