Beispiel #1
0
        private async Task <bool> ExecuteTasksDeleteAsync(string url, List <TaskItem> taskItems)
        {
            foreach (var taskItem in taskItems)
            {
                var httpRequestMessage = ServiceHelper.GenerateDeleteOutlookTaskHttpRequest(url, taskItem);
                var result             = await this.httpClient.SendAsync(httpRequestMessage);

                if (!result.IsSuccessStatusCode)
                {
                    throw new Exception();
                }
            }

            return(true);
        }
Beispiel #2
0
        private async Task <bool> ExecuteTasksDeleteAsync(string url, List <TaskItem> taskItems)
        {
            foreach (var taskItem in taskItems)
            {
                var httpRequestMessage = ServiceHelper.GenerateDeleteOutlookTaskHttpRequest(url, taskItem);
                var result             = await this.httpClient.SendAsync(httpRequestMessage);

                if (!result.IsSuccessStatusCode)
                {
                    dynamic          responseContent  = JObject.Parse(await result.Content.ReadAsStringAsync());
                    ServiceException serviceException = ServiceHelper.GenerateServiceException(responseContent);
                    throw serviceException;
                }
            }

            return(true);
        }