DataServiceContext.GetReadStream Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets binary property data for the specified entity as a data stream.
Overloads
GetReadStream(Object) |
Gets binary property data for the specified entity as a data stream. |
GetReadStream(Object, DataServiceRequestArgs) |
Gets binary property data for the specified entity as a data stream along with the specified message headers. |
GetReadStream(Object, String) |
Gets binary property data for the specified entity as a data stream, with the specified Accept message header. |
GetReadStream(Object)
Gets binary property data for the specified entity as a data stream.
public:
System::Data::Services::Client::DataServiceStreamResponse ^ GetReadStream(System::Object ^ entity);
public System.Data.Services.Client.DataServiceStreamResponse GetReadStream (object entity);
member this.GetReadStream : obj -> System.Data.Services.Client.DataServiceStreamResponse
Public Function GetReadStream (entity As Object) As DataServiceStreamResponse
Parameters
- entity
- Object
The entity that has the binary property to retrieve.
Returns
An instance of DataServiceStreamResponse that represents the response.
Exceptions
The entity
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 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.
Applies to
GetReadStream(Object, DataServiceRequestArgs)
Gets binary property data for the specified entity as a data stream along with the specified message headers.
public:
System::Data::Services::Client::DataServiceStreamResponse ^ GetReadStream(System::Object ^ entity, System::Data::Services::Client::DataServiceRequestArgs ^ args);
public System.Data.Services.Client.DataServiceStreamResponse GetReadStream (object entity, System.Data.Services.Client.DataServiceRequestArgs args);
member this.GetReadStream : obj * System.Data.Services.Client.DataServiceRequestArgs -> System.Data.Services.Client.DataServiceStreamResponse
Public Function GetReadStream (entity As Object, args As DataServiceRequestArgs) As DataServiceStreamResponse
Parameters
- entity
- Object
The entity that has the binary property to retrieve.
Instance of DataServiceRequestArgs class that contains settings for the HTTP request message.
Returns
An instance of DataServiceStreamResponse that represents the response.
Exceptions
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 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.
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
GetReadStream(Object, String)
Gets binary property data for the specified entity as a data stream, with the specified Accept message header.
public:
System::Data::Services::Client::DataServiceStreamResponse ^ GetReadStream(System::Object ^ entity, System::String ^ acceptContentType);
public System.Data.Services.Client.DataServiceStreamResponse GetReadStream (object entity, string acceptContentType);
member this.GetReadStream : obj * string -> System.Data.Services.Client.DataServiceStreamResponse
Public Function GetReadStream (entity As Object, acceptContentType As String) As DataServiceStreamResponse
Parameters
- entity
- Object
The entity that has the binary property to retrieve.
- acceptContentType
- String
The content type of the data requested from the data service, specified in the Accept header.
Returns
An instance of DataServiceStreamResponse that represents the response.
Exceptions
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 acceptContentType
parameter should be a valid value for the Accept HTTP header.
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.
No validation is performed on the headers that are set in acceptContentType
. Therefore, do not change this HTTP header in a way that changes the meaning of the request.