private CommandResult( TAggregateRoot aggregateRoot, EventRouter<TAggregateRoot, TDomainEventBase> routes, ImmutableList<TDomainEventBase> appliedEvents) { AggregateRoot = aggregateRoot; _routes = routes; _appliedEvents = appliedEvents; }
/// <summary> /// Sets an EventRouter for routing events to apply methods on the aggregate root. /// </summary> public CommandResult<TAggregateRoot, TDomainEventBase> WithEventRouter( EventRouter<TAggregateRoot, TDomainEventBase> routes) { return new CommandResult<TAggregateRoot, TDomainEventBase>(AggregateRoot, routes, _appliedEvents); }