Who is responsible for entity's mutation when domain event is raised? DDD
问题 I've been learning about CQRS / ES . Looking at small example projects I often see events mutating the entity state . For instance If we look at the Order aggregate root : public class Order : AggregateRoot { private void Apply(OrderLineAddedEvent @event) { var existingLine = this.OrderLines.FirstOrDefault( i => i.ProductId == @event.ProductId); if(existingLine != null) { existingLine.AddToQuantity(@event.Quantity); return; } this.OrderLines.Add(new OrderLine(@event.ProductId, @event