Udostępnij za pośrednictwem


IDataServiceStreamProvider.GetStreamContentType Method

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

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

Syntax

'Declaration
Function GetStreamContentType ( _
    entity As Object, _
    operationContext As DataServiceOperationContext _
) As String
'Usage
Dim instance As IDataServiceStreamProvider 
Dim entity As Object 
Dim operationContext As DataServiceOperationContext 
Dim returnValue As String 

returnValue = instance.GetStreamContentType(entity, _
    operationContext)
string GetStreamContentType(
    Object entity,
    DataServiceOperationContext operationContext
)
String^ GetStreamContentType(
    Object^ entity, 
    DataServiceOperationContext^ operationContext
)
abstract GetStreamContentType : 
        entity:Object * 
        operationContext:DataServiceOperationContext -> string
function GetStreamContentType(
    entity : Object, 
    operationContext : DataServiceOperationContext
) : String

Parameters

  • entity
    Type: System.Object
    The entity that is a media link entry with a related media resource.

Return Value

Type: System.String
A valid MIME Content-Type value for 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.

See Also

Reference

IDataServiceStreamProvider Interface

System.Data.Services.Providers Namespace