Example #1
0
        private async Task <string> CreateTaskFolderAsync(string taskFolderName)
        {
            try
            {
                var httpRequestMessage = ServiceHelper.GenerateCreateTaskFolderHttpRequest(this.graphBaseUrl + "taskFolders", taskFolderName);
                var result             = await this.httpClient.SendAsync(httpRequestMessage);

                dynamic responseContent = JObject.Parse(await result.Content.ReadAsStringAsync());
                return((string)responseContent.id);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        private async Task <string> CreateTaskFolderAsync(string taskFolderName)
        {
            var httpRequestMessage = ServiceHelper.GenerateCreateTaskFolderHttpRequest(GraphBaseUrl + "taskFolders", taskFolderName);
            var result             = await this.httpClient.SendAsync(httpRequestMessage);

            dynamic responseContent = JObject.Parse(await result.Content.ReadAsStringAsync());

            if (result.IsSuccessStatusCode)
            {
                return((string)responseContent.id);
            }
            else
            {
                ServiceException serviceException = ServiceHelper.GenerateServiceException(responseContent);
                throw serviceException;
            }
        }