Exemplo n.º 1
0
        /// <summary>
        /// Update the specified user.
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public async Task <Guid> UpdateUserAsync(Models.UserModel user)
        {
            var json     = user.Serialize();
            var content  = new StringContent(json, Encoding.UTF8, "application/json");
            var response = await _client.PutAsync($"{this.Options.Admin.Authority}/users/{user.Id}", content);

            return(response.HandleResponse(user.Id));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create a new user.
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public async Task <Models.UserModel> CreateUserAsync(Models.UserModel user)
        {
            var json     = user.Serialize();
            var content  = new StringContent(json, Encoding.UTF8, "application/json");
            var response = await _client.PostAsync($"{this.Options.Admin.Authority}/users", content);

            return(await response.HandleResponseAsync <Models.UserModel>());
        }