예제 #1
0
 public void TestBookSearch()
 {
     String searchString = "Abhishek";
     IBookService bookService = new BookService();
     IList<Book> returnedList = bookService.BookSearch(searchString);
     Book book = returnedList.FirstOrDefault();
     Console.Write(book.Price);
     Assert.IsNotNull(returnedList.FirstOrDefault());
 }
예제 #2
0
 public ActionResult SearchBook(String userId , String searchString)
 {
     try
     {
         ViewBag.userId = userId;
         IBookService bookService = new BookService();
         IList<Book> bookList = bookService.BookSearch(searchString);
         return View(bookList);
     }
     catch (Exception e)
     {
         Console.WriteLine("SearchBook Error");
         Console.Write(e.ToString());
         return Content("Error");
     }
 }