Share via


ODataUtils Class

Definition

Utility methods used with the OData library.

public static class ODataUtils
type ODataUtils = class
Public Module ODataUtils
Inheritance
ODataUtils

Methods

AppendDefaultHeaderValue(String, String, ODataVersion)

Append default values required by OData to specified HTTP header.

When header name is ODataConstants.ContentTypeHeader, if header value is application/json append the following default values for 4.0: odata.metadata=minimal odata.streaming=true IEEE754Compatible=false append the following default values for 4.01: metadata=minimal streaming=true IEEE754Compatible=false

AppendDefaultHeaderValue(String, String)

Append default values required by OData to specified HTTP header.

When header name is ODataConstants.ContentTypeHeader: If header value is application/json, append the following default values: (odata.)metadata=minimal (odata.)streaming=true IEEE754Compatible=false

CreateAnnotationFilter(String)

Translates the annotationFilter to a func that would evaluate whether the filter would match a given annotation name. The func would evaluate to true if the annotationFilter matches the annotation name that's passed to the it, and false otherwise.

GenerateServiceDocument(IEdmModel)

Generate a default ODataServiceDocument instance from model.

GetEmptyArray<T>()
GetReadFormat(ODataMessageReader)

Returns the format used by the message reader for reading the payload.

NullValueReadBehaviorKind(IEdmModel, IEdmProperty)

Gets the reader behavior for null property value on the specified property.

ODataVersionToString(ODataVersion)

Displays the OData version to string representation.

SetHeadersForPayload(ODataMessageWriter, ODataPayloadKind)

Sets the content-type and OData-Version headers on the message used by the message writer.

SetNullValueReaderBehavior(IEdmModel, IEdmProperty, ODataNullValueBehaviorKind)

Adds a transient annotation to indicate how null values for the specified property should be read.

StringToODataVersion(String)

Displays a string to OData version representation.

Applies to