IDataServiceStreamProvider.GetReadStream Method (Object, String, Nullable<Boolean>, DataServiceOperationContext)


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

Returns a stream that contains the media resource data for the specified entity, which is a media link entry.

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

Stream GetReadStream(
	object entity,
	string etag,
	Nullable<bool> checkETagForEquality,
	DataServiceOperationContext operationContext


Type: System.Object

The entity that is a media link entry with a related media resource.

Type: System.String

The eTag value sent as part of the HTTP request that is sent to the data service.

Type: System.Nullable<Boolean>

A nullable Boolean value that determines whether the data service must the type of eTag that is used.

Type: System.Data.Services.DataServiceOperationContext

The DataServiceOperationContext instance used by the data service to process the request.

Return Value

Type: System.IO.Stream

The data Stream that contains the binary property data of the entity.

eTag is the value of an If-Match or If-None-Match header. The following values are supported:

  • true - when the eTag represents an If-Match header.

  • false - when the eTag represents an If-None-Match header.

  • null - when an If-Match or If-None-Match header is not present in the request.

The GetReadStream method is called by the data service runtime to acquire the stream that the data service returns to the client when the client requests the media resource for the specified entity, which is a media link entry. For more information, see Streaming Provider (WCF Data Services).

.NET Framework
Available since 3.5
Return to top