Share via


ODataMessageWriterSettings.UseKeyAsSegment Property

 

Gets or sets a value that indicates whether the writer should put key values in their own URI segment when automatically building URIs.

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

Syntax

public Nullable<bool> UseKeyAsSegment {
    [CompilerGeneratedAttribute]
    get;
    [CompilerGeneratedAttribute]
    set;
}
public:
property Nullable<bool> UseKeyAsSegment {
    [CompilerGeneratedAttribute]
    Nullable<bool> get();
    [CompilerGeneratedAttribute]
    void set(Nullable<bool> value);
}
member UseKeyAsSegment : Nullable<bool> with get, set
Public Property UseKeyAsSegment As Nullable(Of Boolean)

Property Value

Type: System.Nullable<Boolean>

true if the writer should put key values in their own URI segment when automatically building URIs; otherwise, false.

Remarks

If this value is false, automatically-generated URLs will take the form "../EntitySet('KeyValue')/..". If this value is true, automatically-generated URLs will take the form "../EntitySet/KeyValue/..". If this value is not set (null), decision will be made based on the "Com.Microsoft.OData.Service.Conventions.V1.UrlConventions" vocabulary annotation on the IEdmEntityContainer, if available. The default behavior is to put key values inside parentheses and not a distinct URL segments. This setting only applies to URLs that are automatically generated by the ODataMessageWriter and does not modify URLs explicitly provided by the user.

See Also

ODataMessageWriterSettings Class
Microsoft.OData.Core Namespace

Return to top