The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataServiceContext.GetReadStream Method (Object)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets binary property data for the specified entity as a data stream.

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

public DataServiceStreamResponse GetReadStream(
	object entity


Type: System.Object

The entity that has the binary property to retrieve.

Return Value

Type: System.Data.Services.Client.DataServiceStreamResponse

An instance of DataServiceStreamResponse that represents the response.

Exception Condition

The entity is null.


The entity is not tracked by this DataServiceContext.


The entity is in the Added state.


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

The GetReadStream method synchronously 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.

.NET Framework
Available since 3.5
Return to top