public void Run()
        {
            Validate();

            if (HasNotifications())
                return;

            _userRepository.Create(_userCommand.ToDomain());
        }
示例#2
0
        public async Task ExecuteAsync(CreateUserCommand command, CancellationToken cancellationToken = default)
        {
            try
            {
                ValidateCommand(command);

                var user = command.ToDomain();

                await _userRepository.AddAsync(user, cancellationToken);

                await _userRepository.SaveChangesAsync();
            }
            catch (Exception ex)
            { throw ex; }
        }