/// <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)); }
/// <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)); }
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")); }
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."; }