Exemplo n.º 1
0
        public void Handle(TCommand command)
        {
            command.ThrowIfNull(nameof(command));

            using (_scopeStarter.BeginScope())
            {
                ICommandHandler <TCommand> handler = _decorateeFactory.Invoke();
                handler.Handle(command);
            }
        }
        public TResult Handle(TQuery query)
        {
            query.ThrowIfNull(nameof(query));

            using (_scopeStarter.BeginScope())
            {
                IQueryHandler <TQuery, TResult> handler = _decorateeFactory.Invoke();
                return(handler.Handle(query));
            }
        }