/// <summary> /// the customSearch method, used to find a book based on its ISBN. /// </summary> /// <param name="searchItem">ISBN</param> /// <returns>Book with the ISBN if it exists</returns> public Book CustomSearch(string searchItem) { if (bookRepo.All().Where(b => b.Isbn == searchItem) != null) { return(bookRepo.All().Where(b => b.Isbn == searchItem).First()); } else { throw new InputNotFoundException(); } }
/// <summary> /// Returns all the books from the database /// </summary> /// <returns></returns> public IEnumerable <Book> All() { return(bookRepository.All()); }
/// <summary> /// Get all books from database. /// </summary> /// <returns>A list of all books in database.</returns> public IEnumerable <Book> All() { return(BookRepository.All().OrderBy(book => book.Title)); }
/// <summary> /// return all books /// </summary> /// <returns></returns> public IEnumerable <Book> All() { return(bookRepository.All().OrderByDescending(book => book.Id)); }