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