Exemplo n.º 1
0
        Create <TAggregateRoot, TDomainEventBase>(
            TAggregateRoot aggregateRoot,
            ApplyEventRouter <TAggregateRoot, TDomainEventBase> applyEventRouter)
        {
            var commandResult = new CommandResult <TAggregateRoot, TDomainEventBase>(aggregateRoot);

            return(new CommandExecutionContext <TAggregateRoot, TDomainEventBase>(commandResult, applyEventRouter));
        }
Exemplo n.º 2
0
        static ShoppingCart()
        {
            var routes = new ApplyEventRouterBuilder <ShoppingCart, IDomainEvent>();

            routes.Add <ShoppingCartCreated>((agg, e) => agg.Apply(e));
            routes.Add <ItemAddedToShoppingCart>((agg, e) => agg.Apply(e));

            ApplyEventRouter = routes.Build();
        }