Beispiel #1
0
        public async Task <(bool, ModelStateDictionary)> DeleteAsync(Guid playerId, ModelStateDictionary modelStateDictionary)
        {
            (string deleteResp, string errorMessage) = await httpClientManager.DeleteAsync <string>($"{endpointOptions?.Value.Endpoint}{playerId}");

            if (!string.IsNullOrEmpty(errorMessage))
            {
                modelStateDictionary.AddModelError("Player", _Failed_ToDeletePlayer);
            }

            return(string.IsNullOrEmpty(deleteResp), modelStateDictionary);
        }
Beispiel #2
0
        public async Task Delete(EntityDto <Guid> user)
        {
            string url = _config["App:IdentityServerAddress"] + "api/users/" + user.Id;
            HttpResponseMessage response = await _client.DeleteAsync(new Uri(url));

            if (response.IsSuccessStatusCode)
            {
                return;
            }
            else
            {
                var result = response.Content.ReadAsStringAsync().Result;
                throw new UserFriendlyException(result);
            }
        }