Пример #1
0
 /// <summary>
 /// Creates the book.
 /// </summary>
 /// <param name="book">The book.</param>
 /// <returns></returns>
 public Book CreateBook(Book book)
 {
     BookRepository.AddBook(book);
     return(book);
 }
Пример #2
0
 /// <summary>
 /// Updates the book.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <param name="book"></param>
 /// <returns></returns>
 public Book UpdateBook(string id, Book book)
 {
     BookRepository.UpdateBook(id, book);
     return(book);
 }
Пример #3
0
 /// <summary>
 /// Gets the book by id.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <returns></returns>
 public Book GetBookById(string id)
 {
     return(BookRepository.GetBookByID(id));
 }
Пример #4
0
 /// <summary>
 /// Deletes the book.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <returns></returns>
 public void DeleteBook(string id)
 {
     BookRepository.DeleteBook(id);
 }
Пример #5
0
 /// <summary>
 /// Gets all books.
 /// </summary>
 /// <returns></returns>
 public IEnumerable <Book> GetAllBooks()
 {
     return(BookRepository.GetAllBooks());
 }