public Result AddUser(UserDto userDto)
        {
            var resultInProgress = _resultInProgressFactory.CreateResultInProgress();
            var command          = new AddUserCommand(new User(userDto.Name, userDto.Surname), resultInProgress);

            _addUserCommandDispatcher.Execute(command);
            return(resultInProgress.CreateResult());
        }
Example #2
0
        public Result AddUser(UserDto userDto)
        {
            var resultInProgress = _resultInProgressFactory.CreateResultInProgress();
            var command          = _commandFactory.CreateAddUserCommand(userDto, resultInProgress);

            command.Execute();
            return(resultInProgress.CreateResult());
        }