/// <summary> /// Deletes the item on the server with the specified item-id. /// </summary> /// <param name="itemReference"></param> /// <param name="options"></param> /// <returns></returns> public async Task <bool> DeleteItemAsync(ODItemReference itemReference, ItemDeleteOptions options) { if (!itemReference.IsValid()) { throw new ArgumentException("itemReference was invalid. Requires either an ID or Path"); } if (null == options) { throw new ArgumentNullException("options"); } Uri serviceUri = UriForItemReference(itemReference); var request = await CreateHttpRequestAsync(serviceUri, ApiConstants.HttpDelete); options.ModifyRequest(request); var response = await GetHttpResponseAsync(request); if (response.StatusCode == System.Net.HttpStatusCode.NoContent) { return(true); } else { throw await response.ToException(); } }
/// <summary> /// Deletes the item on the server with the specified item-id. /// </summary> /// <param name="itemReference"></param> /// <param name="options"></param> /// <returns></returns> public async Task<bool> DeleteItemAsync(ODItemReference itemReference, ItemDeleteOptions options) { if (!itemReference.IsValid()) throw new ArgumentException("itemReference was invalid. Requires either an ID or Path"); if (null == options) throw new ArgumentNullException("options"); Uri serviceUri = UriForItemReference(itemReference); var request = await CreateHttpRequestAsync(serviceUri, ApiConstants.HttpDelete); options.ModifyRequest(request); var response = await GetHttpResponseAsync(request); if (response.StatusCode == System.Net.HttpStatusCode.NoContent) { return true; } else { throw await response.ToException(); } }