public void ChangeAuthor(string firstName, string lastName) { AddDomainEvent(new BookChangeEvent(BookName)); AddDomainEvent(new NewBookChangeEvent(BookName)); Author = new BookAuthor(firstName, lastName); }
public Book(string bookName, string authorFirstName, string authorLastName) { if (string.IsNullOrEmpty(bookName)) { throw new SoftlyMiCakeException("书名不能为空"); } Id = Guid.NewGuid(); BookName = bookName; Author = new BookAuthor(authorFirstName, authorLastName); }
public void ChangeAuthor(string firstName, string lastName) { Author = new BookAuthor(firstName, lastName); }