IDataServiceStreamProvider.GetReadStreamUri Method

Returns the URI that is used to request the media resource that belongs to the specified entity.

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

Uri GetReadStreamUri(
	Object entity,
	DataServiceOperationContext operationContext


Type: System.Object
The entity that is a media link entry with a related media resource.
Type: System.Data.Services.DataServiceOperationContext
The DataServiceOperationContext instance used by the data service to process the request.

Return Value

Type: System.Uri
A Uri value that is used to request the binary data stream.

This method is invoked by the data services framework to obtain the URI clients should use when making retrieve (ie. GET) requests to the stream(ie. Media Resource). This metadata is needed when constructing the payload for the Media Link Entry associated with the stream (aka Media Resource). This method was added such that a Media Link Entry’s representation could state that a stream (Media Resource) is to be edited using one URI and read using another. This is supported such that a data service could leverage a Content Distribution Network for its stream content. The URI returned maps to the value of the src attribute on the atom:content element of a payload representing the Media Link Entry associated with the stream described by this DataServiceStreamDescriptor instance. If the JSON format is used (as noted in section 3.2.3) this URI represents the value of the src_media name/value pair. The returned URI MUST be an absolute URI and represents the location where a consumer (reader) of the stream should send requests to in order to obtain the contents of the stream. If URI returned is null, then the data service runtime will automatically generate the URI representing the location where the stream can be read from. The URI generated by the runtime will equal the canonical URI for the associated Media Link Entry followed by a “/$value” path segment. NOTE: Altering properties on the operationContext parameter may corrupt the response from the data service.