2016-07-25 72 views
1

UpsertDocumentAsync和CreateDocumentAsync由於某種原因停止工作。 正在執行此行:UpsertDocumentAsync返回204「無內容」

_client.UpsertDocumentAsync(UriFactory.CreateDocumentCollectionUri(databaseId, collectionId), new { MyProperty = "A Value" }); 

並獲得響應204(無內容)。根據MSDN只有DELETE操作返回這個狀態碼。 databaseId和collectionId是正確的。什麼可能是問題?

回答

0

我做了我的Web API方法異步,它解決了這個問題。

public async Task<Document> Post(dynamic doc) 
{ 
    return await _client.UpsertDocumentAsync(UriFactory.CreateDocumentCollectionUri(databaseId, collectionId), doc); 
}