コード例 #1
0
        /// <summary>
        /// Deletes the value of the specified attribute and entity id
        /// </summary>
        /// <returns>The response object</returns>
        public async Task <StatusCode> DeleteAttributeForEntityAsync(string entityId, string attributeName)
        {
            RESTClient <StatusCode> client = new RESTClient <StatusCode>(OrionConfig.AuthHeaderKey, _config.Token);
            string uri = string.Format(OrionConfig.ConvenienceUrlFormatTwoParams, _config.BaseUrl, _config.Version1Path, OrionConfig.ContextEntitiesPath, entityId, OrionConfig.AttributesPath, attributeName);

            return(await client.DeleteAsync(uri));
        }
コード例 #2
0
        /// <summary>
        /// Deletes the entity with the specified id
        /// </summary>
        /// <returns>The response object</returns>
        public async Task <ContextResponse> DeleteEntityAsync(string entityId)
        {
            RESTClient <ContextResponse> client = new RESTClient <ContextResponse>(OrionConfig.AuthHeaderKey, _config.Token);
            string uri = string.Format(OrionConfig.ConvenienceUrlFormat, _config.BaseUrl, _config.Version1Path, OrionConfig.ContextEntitiesPath, entityId);

            return(await client.DeleteAsync(uri));
        }
コード例 #3
0
ファイル: RESTClientUnitTest.cs プロジェクト: dfgs/RESTLib
        public async Task ShouldThrowExceptionIfDeleteStatusCodeIsNotOK()
        {
            RESTClient client;

            client = new RESTClient(new MockedHttpConnector(System.Net.HttpStatusCode.NotFound), new ResponseDeserializer());

            await Assert.ThrowsExceptionAsync <RESTException>(() => client.DeleteAsync <string>("root/test"));
        }
コード例 #4
0
        public async Task Delete(System.Collections.IList movies)
        {
            Message = "Please Wait...";
            int counter = 0;

            foreach (Movie item in movies)
            {
                await client.DeleteAsync(item.Code);

                counter++;
            }
            Message = $"{counter} record(s) were deleted.";
        }