コード例 #1
0
        public async Task AddUser(UserAddUICommand user)
        {
            var userJson =
                new StringContent(
                    JsonSerializer.Serialize(user),
                    Encoding.UTF8,
                    "application/json");

            var response = await _httpClient.PostAsync(
                $"api/Users", userJson);
        }
コード例 #2
0
        public async Task Add(UserAddUICommand command)
        {
            var newUser = User.Create(command.User.UserName,
                                      _initialPassword,
                                      command.User.TrueName,
                                      command.User.Gender,
                                      command.User.CardId,
                                      command.User.Phone,
                                      command.User.RoleId,
                                                  //_userAuthenticationManager.CurrentUser.UserId,
                                      Guid.Empty, // TODO:后期用IdentityServer4来解决
                                      _timeSource.GetCurrentTime());

            using var unitOfWork = _unitOfWorkFactory.GetCurrentUnitOfWork();
            _userRepository.Add(newUser);
            await unitOfWork.Commit();
        }
コード例 #3
0
 public async Task PostUser(UserAddUICommand command)
 {
     await _userLogicService.Add(command);
 }