IDataServiceStreamProvider2.GetStreamContentType Method (Object, ResourceProperty, DataServiceOperationContext)

WCF Data Services 5.0

Returns the content-type of the specified named stream.

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

string GetStreamContentType(
	Object entity,
	ResourceProperty streamProperty,
	DataServiceOperationContext operationContext


Type: System.Object
The entity to which the named stream belongs.
Type: System.Data.Services.Providers.ResourceProperty
A ResourceProperty object that represents the named stream.
Type: System.Data.Services.DataServiceOperationContext
The DataServiceOperationContext instance used by the data service to process the request.

Return Value

Type: System.String
A valid MIME Content-Type value for the binary data.

Use the GetStreamContentType method implementation to set the Content-Type of the media resource. Do not directly set the Content-Type header in your IDataServiceStreamProvider2 provider implementation.