コード例 #1
0
        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; }
        }