Επεξεργασία

Κοινή χρήση μέσω


IDataServiceStreamProvider.GetStreamContentType Method

Definition

Returns the content type of the media resource that belongs to the specified entity.

public:
 System::String ^ GetStreamContentType(System::Object ^ entity, System::Data::Services::DataServiceOperationContext ^ operationContext);
public string GetStreamContentType (object entity, System.Data.Services.DataServiceOperationContext operationContext);
abstract member GetStreamContentType : obj * System.Data.Services.DataServiceOperationContext -> string
Public Function GetStreamContentType (entity As Object, operationContext As DataServiceOperationContext) As String

Parameters

entity
Object

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

operationContext
DataServiceOperationContext

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

Returns

A valid Content-Type of the binary data.

Remarks

The GetStreamContentType method is called by the data service runtime to retrieve the Content-Type of the media resource that belongs to the specified entity. Use the GetStreamContentType method implementation to set the Content-Type of the media resource. Do not directly set the Content-Type header in your IDataServiceStreamProvider provider implementation.

Applies to