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