DocumentClient.ReadAttachmentFeedAsync Method

Definition

Overloads

ReadAttachmentFeedAsync(String, FeedOptions)

Reads the feed (sequence) of Attachment for a document from the Azure DocumentDB database service as an asynchronous operation.

ReadAttachmentFeedAsync(Uri, FeedOptions)

Reads the feed (sequence) of attachments for a document as an asynchronous operation from the Azure DocumentDB database service.

ReadAttachmentFeedAsync(String, FeedOptions)

Reads the feed (sequence) of Attachment for a document from the Azure DocumentDB database service as an asynchronous operation.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.FeedResponse<Microsoft.Azure.Documents.Attachment>> ReadAttachmentFeedAsync (string attachmentsLink, Microsoft.Azure.Documents.Client.FeedOptions options = null);
Parameters
attachmentsLink
String

The SelfLink of the resources to be read. E.g. /dbs/db_rid/colls/coll_rid/docs/doc_rid/attachments/

options
FeedOptions

(Optional) The request options for the request.

Returns

A System.Threading.Tasks containing a ResourceResponse<TResource> which wraps a Attachment containing the read resource record.

Exceptions

If attachmentsLink is not set.

This exception can encapsulate many different types of errors. To determine the specific error always look at the StatusCode property. Some common codes you may get when creating a Document are:

StatusCodeReason for exception
404NotFound - This means the resource feed you tried to read did not exist. Check the parent rids are correct.
429TooManyRequests - This means you have exceeded the number of request units per second. Consult the DocumentClientException.RetryAfter value to see how long you should wait before retrying this operation.

ReadAttachmentFeedAsync(Uri, FeedOptions)

Reads the feed (sequence) of attachments for a document as an asynchronous operation from the Azure DocumentDB database service.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.FeedResponse<Microsoft.Azure.Documents.Attachment>> ReadAttachmentFeedAsync (Uri attachmentsUri, Microsoft.Azure.Documents.Client.FeedOptions options = null);
Parameters
attachmentsUri
Uri

the URI for the attachments.

options
FeedOptions

The request options for the request.

Returns

The task object representing the service response for the asynchronous operation.