public void Delete(string key, Guid? etag)
{
EnsureIsNotNullOrEmpty(key, "key");
var metadata = new JObject();
if (etag != null)
metadata.Add("ETag", new JValue(etag.Value.ToString()));
AddTransactionInformation(metadata);
var httpJsonRequest = new HttpJsonRequest(url + "/docs/" + key, "DELETE", metadata);
try
{
httpJsonRequest.ReadResponseString();
}
catch (WebException e)
{
var httpWebResponse = e.Response as HttpWebResponse;
if (httpWebResponse == null ||
httpWebResponse.StatusCode != HttpStatusCode.Conflict)
throw;
throw ThrowConcurrencyException(e);
}
}