public void Run() { Validate(); if (HasNotifications()) return; _userRepository.Create(_userCommand.ToDomain()); }
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; } }