public async Task <IActionResult> SetUserProfile([FromBody] UserApiModel model) { UserApiModelValidator validator = new UserApiModelValidator(_resourceManager); var validResult = validator.Validate(model); if (!validResult.IsValid) { return(BadRequest(new MessageApiModel() { Message = validResult.ToString() })); } var id = User.FindFirst("id")?.Value; model.Id = id; var result = await _userService.UpdateUserAsync(model); return(Ok(result)); }
public UsersController(IClientManagementStore clientManagementStore, IUserStore userStore, IExternalIdentityProviderServiceResolver externalIdentityProviderServiceResolver, UserApiModelValidator validator, ILogger logger) : base(validator, logger) { _clientManagementStore = clientManagementStore ?? throw new ArgumentNullException(nameof(clientManagementStore)); _userStore = userStore ?? throw new ArgumentNullException(nameof(userStore)); _externalIdentityProviderServiceResolver = externalIdentityProviderServiceResolver ?? throw new ArgumentNullException(nameof(externalIdentityProviderServiceResolver)); }