private void Apply(ReviewCreatedEvent @event) { Id = @event.ReviewId; MovieId = @event.MovieId; UserId = @event.UserId; Text = @event.Text; Rating = (RatingEnum)@event.Rating; }
private ReviewAggregate(Guid userId, Guid movieId, string text, RatingEnum rating) { var @event = new ReviewCreatedEvent { ReviewId = Guid.NewGuid(), MovieId = movieId, UserId = userId, Text = text, Rating = (int)rating }; Enqueue(@event); Apply(@event); }
public void Apply(ReviewCreatedEvent @event) { Entity = @event.Review; }