OneDrive/ODConnection.public.cs
/// <summary>
/// Update an item referenced by itemReference with the changes in the changes parameter.
/// All fields that are not changed in an Item should be set to null before passing the item
/// into this call.
/// </summary>
/// <param name="itemReference"></param>
/// <param name="changes"></param>
/// <returns></returns>
Update an item referenced by itemReference with the changes in the changes parameter.
All fields that are not changed in an Item should be set to null before passing the item
into this call.
Update an item referenced by itemReference with the changes in the changes parameter . All fields that are not changed in an Item should be set to null before passing the item into this call .
public async Task<ODItem> PatchItemAsync(ODItemReference itemReference, ODItem changes)
        {
            if (!itemReference.IsValid()) throw new ArgumentException("itemReference is not a valid reference.");
            if (null == changes) throw new ArgumentNullException("changes");
            Uri serviceUri = UriForItemReference(itemReference);
            var request = await CreateHttpRequestAsync(serviceUri, ApiConstants.HttpPatch);
            await SerializeObjectToRequestBody(changes, request);
            var response = await GetHttpResponseAsync(request);
            if (response.StatusCode.IsSuccess())
            {
                return await response.ConvertToDataModel<ODItem>();
            }
            else
            {
                throw await response.ToException();
            }
        }
public async Task < ODItem > PatchItemAsync ( ODItemReference itemReference , ODItem changes ) { if ( ! itemReference . IsValid ( ) ) throw new ArgumentException ( " " ) ; if ( null == changes ) throw new ArgumentNullException ( " " ) ; Uri serviceUri = UriForItemReference ( itemReference ) ; var request = await CreateHttpRequestAsync ( serviceUri , ApiConstants . HttpPatch ) ; await SerializeObjectToRequestBody ( changes , request ) ; var response = await GetHttpResponseAsync ( request ) ; if ( response . StatusCode . IsSuccess ( ) ) { return await response . ConvertToDataModel < ODItem > ( ) ; } else { throw await response . ToException ( ) ; } }
Update an item referenced by itemReference with the changes in the changes parameter.
Update an item referenced by itemReference with the changes in the changes parameter .
None
itemReference
ODItemReference
None
changes
ODItem
None