ODataMessageReaderSettings.UndeclaredPropertyBehaviorKinds Property

 

Gets or sets the behavior the reader should use when it finds undeclared property.

Namespace:   Microsoft.OData.Core
Assembly:  Microsoft.OData.Core (in Microsoft.OData.Core.dll)

Syntax

public ODataUndeclaredPropertyBehaviorKinds UndeclaredPropertyBehaviorKinds {
    [CompilerGeneratedAttribute]
    get;
    [CompilerGeneratedAttribute]
    set;
}
public:
property ODataUndeclaredPropertyBehaviorKinds UndeclaredPropertyBehaviorKinds {
    [CompilerGeneratedAttribute]
    ODataUndeclaredPropertyBehaviorKinds get();
    [CompilerGeneratedAttribute]
    void set(ODataUndeclaredPropertyBehaviorKinds value);
}
member UndeclaredPropertyBehaviorKinds : ODataUndeclaredPropertyBehaviorKinds with get, set
Public Property UndeclaredPropertyBehaviorKinds As ODataUndeclaredPropertyBehaviorKinds

Property Value

Type: Microsoft.OData.Core.ODataUndeclaredPropertyBehaviorKinds

The behavior the reader should use when it finds undeclared property.

Remarks

This setting has no effect if there's no model specified for the reader. This setting must be set to Default when reading request payloads. Detailed behavior description: ODataUndeclaredPropertyBehaviorKind.Default If an undeclared property is found reading fails. ODataUndeclaredPropertyBehaviorKind.ReportUndeclaredLinkProperty ATOM - Undeclared deferred navigation link will be read and reported. - Undeclared expanded navigation link will fail. - Undeclared stream property link (both read and edit) will be read and reported. - Undeclared association link will be read and reported. - Undeclared properties inside m:properties fail. Verbose JSON - If an undeclared property is found a detection logic will run: - __deferred value is found - the link will be read and reported as a deferred navigation link. - __mediaresource value is found - the link will be read and reported as a stream property - If nothing from the above matches the reading fails. - Undeclared association links inside __metadata/properties will be read and reported. JSON Light - If an undeclared property is found a detection logic will run: - The property has 'odata.navigationLink' or 'odata.associationLink' annotation on it and no value - it will be read as navigation/association link - The property has 'odata.mediaEditLink', 'odata.mediaReadLink', 'odata.mediaContentType' or 'odata.mediaEtag' on it and no value - it will be read as a stream property. - Any other property (that is property with a value or property with no annotation mentioned above) will fail. ODataUndeclaredPropertyBehaviorKind.IgnoreUndeclaredValueProperty ATOM - Undeclared property inside m:properties is ignored (not even read). - Undeclared navigation link, stream property link or association link fail. Verbose JSON - If an undeclared property is found a detection logic will run: - __deferred value is found - fail as undeclared deferred nav. link. - __mediaresource value is found - fail as undeclared stream property. - All other properties are ignored and not read. - Undeclared association links inside __metadata/properties fail. JSON Light - If an undeclared property is found a detection logic will run: - The property has 'odata.navigationLink' or 'odata.associationLink' annotation on it (deferred or expanded navigation link) - fail as undeclared navigation property - The property has 'odata.mediaEditLink', 'odata.mediaReadLink', 'odata.mediaContentType' or 'odata.mediaEtag' on it and no value - fail as undeclared stream property. - The property has a value and no annotation mentioned above - the property is ignored and not read. ODataUndeclaredPropertyBehaviorKind.ReportUndeclaredLinkProperty | ODataUndeclaredPropertyBehaviorKind.IgnoreUndeclaredValueProperty ATOM - Undeclared deferred navigation link will be read and reported. - Undeclared expanded navigation link will be read and the navigation link part will be reported, the expanded content will be ignored and not read or reported. - Undeclared stream property link (both read and edit) will be read and reported. - Undeclared association link will be read and reported. - Undeclared properties inside m:properties will be ignored and not read. Verbose JSON - If an undeclared property is found a detection logic will run: - __deferred value is found - read and report a deferred navigation link. - __mediaresource value is found - read and report stream property. - All other properties are ignore and not read. - Undeclared association links inside __metadata/properties are read and reported. JSON Light - If an undeclared property is found a detection logic will run: - The property has 'odata.navigationLink' or 'odata.associationLink' annotation on it and no value (deferred navigation link) - it will be read as navigation/association link - The property has 'odata.navigationLink' or 'odata.associationLink' annotation on it and with value (expanded navigation link) - it will be read, the navigation and association link will be reported and the content will be ignored. - The property has 'odata.mediaEditLink', 'odata.mediaReadLink', 'odata.mediaContentType' or 'odata.mediaEtag' on it and no value - it will be read as a stream property. - The property has a value and no annotation mentioned above - the property is ignored and not read. Note that there's one difference between ATOM/JSON Light and Verbose JSON. In ATOM and JSON Light expanded links are treated as both undeclared link and a value property. The URLs are the link part, the expanded content is the value part. In Verbose JSON expanded links are treated as a value property as a whole. Since in JSON expanded links don't actually have the link part (the payload doesn't contain the "href") this is not such a big difference.

See Also

ODataMessageReaderSettings Class
Microsoft.OData.Core Namespace

Return to top