sdk/dotnet/src/Microsoft.Datasync.Client/Table/RemoteTable.cs
/// <summary>
/// Sends a request to the service.
/// </summary>
/// <param name="request">The service request.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
/// <returns>The response from the service.</returns>
/// <exception cref="DatasyncConflictException"></exception>
Sends a request to the service.
Sends a request to the service .
protected async Task<JToken> SendRequestAsync(ServiceRequest request, CancellationToken cancellationToken = default)
        {
            try
            {
                var response = await ServiceClient.HttpClient.SendAsync(request, cancellationToken).ConfigureAwait(false);
                return GetJTokenFromResponse(response);
            }
            catch (DatasyncInvalidOperationException ex) when (ex.IsConflictStatusCode())
            {
                string content = await ex.Response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
                JToken token = string.IsNullOrEmpty(content) ? null : JsonConvert.DeserializeObject<JToken>(content, ServiceClient.Serializer.SerializerSettings);
                JObject value = ValidItemOrNull(token);
                if (value != null)
                {
                    throw new DatasyncConflictException(ex, ValidItemOrNull(token));
                }
                throw;
            }
        }
protected async Task < JToken > SendRequestAsync ( ServiceRequest request , CancellationToken cancellationToken = default ) { try { var response = await ServiceClient . HttpClient . SendAsync ( request , cancellationToken ) . ConfigureAwait ( false ) ; return GetJTokenFromResponse ( response ) ; } catch ( DatasyncInvalidOperationException ex ) when ( ex . IsConflictStatusCode ( ) ) { string content = await ex . Response . Content . ReadAsStringAsync ( cancellationToken ) . ConfigureAwait ( false ) ; JToken token = string . IsNullOrEmpty ( content ) ? null : JsonConvert . DeserializeObject < JToken > ( content , ServiceClient . Serializer . SerializerSettings ) ; JObject value = ValidItemOrNull ( token ) ; if ( value != null ) { throw new DatasyncConflictException ( ex , ValidItemOrNull ( token ) ) ; } throw ; } }
Sends a request to the service.
Sends a request to the service .
The response from the service.
The response from the service .
None
request
ServiceRequest
The service request.
The service request .
cancellationToken
CancellationToken
A  to observe.
A to observe .