Where to raise persistence-dependent domain events – service, repository, or UI?
My solution is that you raise events in both Domain layer and service layer. Your domain: public class Order { public void ChangeStatus(OrderStatus status) { // change status this.Status = status; DomainEvent.Raise(new OrderStatusChanged { OrderId = Id, Status = status }); } public void AddNote(string note) { // add note this.Notes.Add(note) DomainEvent.Raise(new NoteCreatedForOrder { OrderId … Read more