DataServiceResponsePreference Enumeration

Determines whether the client requests that the data service return inserted or updated entity data as an entry in the response message.

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

Syntax

'Declaration
Public Enumeration DataServiceResponsePreference
'Usage
Dim instance As DataServiceResponsePreference
public enum DataServiceResponsePreference
public enum class DataServiceResponsePreference
type DataServiceResponsePreference
public enum DataServiceResponsePreference

Members

Member name Description
IncludeContent Requests that the data service returns a copy of the inserted or changed entity as an entry in the body of the response message.
NoContent Request that the data service not return a copy of the inserted or changed entity as an entry in the body of the response message.
None The Prefer header is not included in the request, which is the default behavior.

Remarks

The client uses the DataServiceResponsePreference value to determine whether to generate the Prefer header. When the Prefer header is generated, this value is also used to determine whether to request that the changed entity be returned from an insert or update operation.

The DataServiceResponsePreference property is used for HTTP POST, HTTP PUT, HTTP MERGE, and HTTP PATCH requests. The IncludeContent value is used by the client to request the data service returns the inserted or updated entity in the body of the response message. When this value is supplied to the AddAndUpdateResponsePreference property of the context, the client includes the return-content value in the Prefer header in the request.

The client always processes entries in the response message to HTTP POST, HTTP MERGE, and HTTP PUT requests, regardless of the IncludeContent setting.

The Prefer header is supported in version 3 of the Open Data Protocol (OData) and later versions.

See Also

Reference

System.Data.Services.Client Namespace