Exemplo n.º 1
0
        public virtual void AddNewBook(Book book)
        {
            if (book == null)
            {
                throw new ArgumentNullException($"{nameof(book)} is null");
            }
            var newBook = new AuthorToBook(book, this);

            PersonalBooks.Add(newBook);
        }
Exemplo n.º 2
0
 public Book(string bookName, DateTime publicationDate, BookCategory category, IList <Author> authors, string description = null)
 {
     ValidateInput(bookName, publicationDate, category, description, authors);
     foreach (var author in authors)
     {
         var authorToBook = new AuthorToBook(this, author);
         Authors.Add(authorToBook);
     }
     Category        = category;
     Name            = bookName;
     PublicationDate = publicationDate;
 }