-
Is it possible to either always display |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Note that there is discussion in the OASIS OData Technical Committee on providing a way through the protocol to explicitly request the @odata.id, separate from the other metadata, for example, $select=$ref, or odata.metadata=id. The issue has been that some services don't return @odata.id, and instead always return key properties. |
Beta Was this translation helpful? Give feedback.
-
@alifemove you may be able to achieve what you're looking for by extending the If you try to retrieve the class ODataIdCustomODataResourceSerializer : ODataResourceSerializer
{
public override ODataResource CreateResource(...)
{
var resource = base.CreateResource(...);
var id = resource.Id;
resource.Id = id;
return resource;
}
} The following blog post shows an end-to-end example of creating and configuring a custom serializer: https://devblogs.microsoft.com/odata/build-formatter-extensions-in-asp-net-core-odata-8-and-hooks-in-odataconnectedservice/ |
Beta Was this translation helpful? Give feedback.
Note that there is discussion in the OASIS OData Technical Committee on providing a way through the protocol to explicitly request the @odata.id, separate from the other metadata, for example, $select=$ref, or odata.metadata=id. The issue has been that some services don't return @odata.id, and instead always return key properties.