DataServiceContext.BeginGetReadStream Method

Definition

Asynchronously gets binary property data for the specified entity as a data stream along with the specified message headers.

public:
 IAsyncResult ^ BeginGetReadStream(System::Object ^ entity, System::Data::Services::Client::DataServiceRequestArgs ^ args, AsyncCallback ^ callback, System::Object ^ state);
public IAsyncResult BeginGetReadStream (object entity, System.Data.Services.Client.DataServiceRequestArgs args, AsyncCallback callback, object state);
member this.BeginGetReadStream : obj * System.Data.Services.Client.DataServiceRequestArgs * AsyncCallback * obj -> IAsyncResult
Public Function BeginGetReadStream (entity As Object, args As DataServiceRequestArgs, callback As AsyncCallback, state As Object) As IAsyncResult

Parameters

entity
Object

The entity that has the binary property to retrieve.

args
DataServiceRequestArgs

Instance of the DataServiceRequestArgs class that contains settings for the HTTP request message.

callback
AsyncCallback

Delegate to invoke when results are available for client consumption.

state
Object

User-defined state object passed to the callback.

Returns

An IAsyncResult object that is used to track the status of the asynchronous operation.

Exceptions

Any of the parameters supplied to the method is null.

The entity is not tracked by this DataServiceContext.

-or-

The entity is in the Added state.

-or-

The entity is not a Media Link Entry and does not have a binary property.

Remarks

The GetReadStream method asynchronously requests a data stream that contains the binary property of the requested entity.

In the AtomPub protocol, the entity is a Media Link Entry and the binary property is the associated Media Resource.

No validation is performed on the headers that are set in args. Therefore, do not change an HTTP header in a way that changes the meaning of the request.

Applies to