コード例 #1
0
 /// <summary>
 /// Replace multiple documents.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="collectionName"></param>
 /// <param name="documents"></param>
 /// <param name="query"></param>
 /// <returns></returns>
 public virtual async Task <PostDocumentsResponse <T> > PutDocumentsAsync <T>(string collectionName,
                                                                              IEnumerable <T> documents, PutDocumentsOptions query = null, CancellationToken cancellationToken = default)
 {
     return(await PutRequestAsync($"{ApiRootPath}/{WebUtility.UrlEncode(collectionName)}",
                                  response => new PostDocumentsResponse <T>(response), documents, query, cancellationToken));
 }
コード例 #2
0
 /// <summary>
 /// Replaces the document with handle <document-handle> with the one in
 /// the body, provided there is such a document and no precondition is
 /// violated.
 /// PUT/_api/document/{document-handle}
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="documentId"></param>
 /// <param name="doc"></param>
 /// <param name="opts"></param>
 /// <returns></returns>
 public virtual async Task <PostDocumentResponse <T> > PutDocumentAsync <T>(string documentId, T document, PutDocumentsOptions query = null, CancellationToken cancellationToken = default)
 {
     ValidateDocumentId(documentId);
     return(await PutRequestAsync($"{ApiRootPath}/{documentId}",
                                  response => new PostDocumentResponse <T>(response), document, query, cancellationToken));
 }