public static Book NewBookFrom( BookId id, BookName bookName, YearOfPrint yearOfPrint) => (Book) new Book().ApplyChange(new BookAdded(id, bookName, yearOfPrint));
private void Apply(BookAdded e) { SetAggregateId(e.AggregateId.ToBookId()); _name = e.Name.ToBookName(); _yearOfPrint = e.YearOfPrint.ToYearOfPrint(); }
public static YearOfPrint ToYearOfPrint(this int yearOfPrintInt) => YearOfPrint.YearOfPrintFrom(yearOfPrintInt);