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); }
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; }