Share via


DataServiceContext.BeginGetReadStream Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

Namespace:  System.Data.Services.Client
Assembly:  System.Data.Services.Client (in System.Data.Services.Client.dll)

Syntax

'Declaration
Public Function BeginGetReadStream ( _
    entity As Object, _
    args As DataServiceRequestArgs, _
    callback As AsyncCallback, _
    state As Object _
) As IAsyncResult
public IAsyncResult BeginGetReadStream(
    Object entity,
    DataServiceRequestArgs args,
    AsyncCallback callback,
    Object state
)

Parameters

  • entity
    Type: System.Object
    The entity that has the binary property to retrieve.
  • callback
    Type: System.AsyncCallback
    The delegate to invoke when results are available for client consumption.
  • state
    Type: System.Object
    The user-defined state object that is passed to the callback.

Return Value

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

Exceptions

Exception Condition
ArgumentNullException

Any of the parameters supplied to the method is nulla null reference (Nothing in Visual Basic).

ArgumentException

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 BeginGetReadStream 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.

Version Information

Silverlight

Supported in: 5, 4

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.