Example #1
0
 public void RemoveBook(Book book)
 {
     var booksToRemove = (from b in Books where b.Book.IsSameTitleAndAuthor(book) select b).ToList();
     if (!booksToRemove.Any()) return;
     foreach (var wishListBook in booksToRemove)
     {
         Books.Remove(wishListBook);
     }
 }
Example #2
0
 public void AddBook(Book book)
 {
     var isBookAlreadyAdded = false; 
     foreach (var wishListBook in Books)
     {
         isBookAlreadyAdded = wishListBook.Book.IsSameTitleAndAuthor(book);
     }
     if (!isBookAlreadyAdded)
         Books.Add(new WishListBook {Book = book});
 }
Example #3
0
		public void BuysBook(Book book)
		{
			OwnedBooks.Add(book);
		}
Example #4
0
	    public bool IsSameEdition(Book book)
	    {
	        return Title == book.Title && Author == book.Author && BookType == book.BookType;
	    }
Example #5
0
	    public bool IsSameTitleAndAuthor(Book book)
		{
			return Title == book.Title && Author == book.Author;
		}