コード例 #1
0
 /// <summary>
 /// Delete multiple documents based on the passed document selectors.
 /// A document selector is either the document ID or the document Key.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="collectionName"></param>
 /// <param name="selectors"></param>
 /// <param name="query"></param>
 /// <returns></returns>
 public virtual async Task <DeleteDocumentsResponse <T> > DeleteDocumentsAsync <T>(string collectionName,
                                                                                   IEnumerable <string> selectors, DeleteDocumentsOptions query = null, CancellationToken cancellationToken = default)
 {
     return(await DeleteRequestAsync($"{ApiRootPath}/{WebUtility.UrlEncode(collectionName)}",
                                     response => new DeleteDocumentsResponse <T>(response), query, selectors, cancellationToken));
 }
コード例 #2
0
 /// <summary>
 /// Delete a document based on its document ID.
 /// </summary>
 /// <param name="documentId"></param>
 /// <param name="query"></param>
 /// <returns></returns>
 public virtual async Task <DeleteDocumentResponse <T> > DeleteDocumentAsync <T>(string documentId,
                                                                                 DeleteDocumentsOptions query = null, CancellationToken cancellationToken = default)
 {
     ValidateDocumentId(documentId);
     return(await DeleteRequestAsync($"{ApiRootPath}/{documentId}",
                                     response => new DeleteDocumentResponse <T>(response), query, cancellationToken));
 }
コード例 #3
0
 /// <summary>
 /// Delete multiple documents based on the passed document selectors.
 /// A document selector is either the document ID or the document Key.
 /// </summary>
 /// <remarks>
 /// This method overload is provided as a convenience when the client does not care about the type of <see cref="DeleteDocumentResponse{T}.Old"/>
 /// in the returned <see cref="DeleteDocumentsResponse{object}"/>. These will be <see cref="null"/> when
 /// <see cref="DeleteDocumentsOptions.ReturnOld"/> is either <see cref="false"/> or not set, so this overload is useful in the default case
 /// when deleting documents.
 /// </remarks>
 /// <param name="collectionName"></param>
 /// <param name="selectors"></param>
 /// <param name="query"></param>
 /// <returns></returns>
 public virtual async Task <DeleteDocumentsResponse <object> > DeleteDocumentsAsync(string collectionName,
                                                                                    IEnumerable <string> selectors, DeleteDocumentsOptions query = null, CancellationToken cancellationToken = default)
 {
     return(await DeleteDocumentsAsync <object>(collectionName, selectors, query, cancellationToken));
 }
コード例 #4
0
 /// <summary>
 /// Delete a document.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="collectionName"></param>
 /// <param name="documentKey"></param>
 /// <param name="query"></param>
 /// <returns></returns>
 public virtual async Task <DeleteDocumentResponse <T> > DeleteDocumentAsync <T>(string collectionName, string documentKey, DeleteDocumentsOptions query = null, CancellationToken cancellationToken = default)
 {
     return(await DeleteDocumentAsync <T>(
                $"{WebUtility.UrlEncode(collectionName)}/{WebUtility.UrlEncode(documentKey)}", query,
                cancellationToken));
 }
コード例 #5
0
 /// <summary>
 /// Delete a document based on its document ID.
 /// </summary>
 /// <remarks>
 /// This method overload is provided as a convenience when the client does not care about the type of <see cref="DeleteDocumentResponse{T}.Old"/>
 /// in the returned <see cref="DeleteDocumentResponse{object}"/>. Its value will be <see cref="null"/> when
 /// <see cref="DeleteDocumentsOptions.ReturnOld"/> is either <see cref="false"/> or not set, so this overload is useful in the default case
 /// when deleting documents.
 /// </remarks>
 /// <param name="documentId"></param>
 /// <param name="query"></param>
 /// <returns></returns>
 public virtual async Task <DeleteDocumentResponse <object> > DeleteDocumentAsync(string documentId,
                                                                                  DeleteDocumentsOptions query = null, CancellationToken cancellationToken = default)
 {
     return(await DeleteDocumentAsync <object>(documentId, query, cancellationToken));
 }