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