OneDrive/ODConnection.public.cs
/// <summary>
/// Deletes the item on the server with the specified item-id.
/// </summary>
/// <param name="itemReference"></param>
/// <param name="options"></param>
/// <returns></returns>
Deletes the item on the server with the specified item-id.
Deletes the item on the server with the specified item - id .
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();
            }
        }
public async Task < bool > DeleteItemAsync ( ODItemReference itemReference , ItemDeleteOptions options ) { if ( ! itemReference . IsValid ( ) ) throw new ArgumentException ( " " ) ; if ( null == options ) throw new ArgumentNullException ( " " ) ; 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 ( ) ; } }
Deletes the item on the server with the specified item-id.
Deletes the item on the server with the specified item - id .
None
itemReference
ODItemReference
None
options
ItemDeleteOptions
None