DocumentClient.ReadOfferAsync
Method
Definition
Reads an Offer from the Azure DocumentDB database service as an asynchronous operation.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Offer>> ReadOfferAsync (string offerLink);
- offerLink
- String
The link to the Offer to be read.
A System.Threading.Tasks containing a ResourceResponse<TResource> which wraps a Offer containing the read resource record.
If offerLink 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:
| StatusCode | Reason for exception |
|---|---|
| 404 | NotFound - This means the resource you tried to read did not exist. |
| 429 | TooManyRequests - 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. |
Remarks
Doing a read of a resource is the most efficient way to get a resource from the Database. If you know the resource's ID, do a read instead of a query by ID.
For an Offer, id is always generated internally by the system when the linked resource is created. id and _rid are always the same for Offer.
The format for offerLink is always "/offers/{offer identifier}"