public void Handle(AddSubThing command) { MyThing t = _repo.GetAggregate(command.AggregateId); t.ApplyEvent(new MySubThingAdded(t.AggregateId, command.Subthing)); _repo.SaveAggregate(t); }
public void Handle(RemoveSubThing command) { MyThing t = _repo.GetAggregate(command.AggregateId); t.ApplyEvent(new SubThingRemoved(t.AggregateId, command.SubThingId)); _repo.SaveAggregate(t); }
public void Handle(UpdateMyThing command) { MyThing t = _repo.GetAggregate(command.Id); t.ApplyEvent(new MyThingUpdated(t.AggregateId, command.Title)); _repo.SaveAggregate(t); }