1

I'm querying the Dataverse OData API server using the Microsoft.OData.Client. I made a class which inherits DataServiceContext and I have property which represents Entity Set that I query.

That works perfectly, but I cannot map fields with name like field_name@OData.Community.Display.V1.FormattedValue. For example:

        [OriginalName("field_name@OData.Community.Display.V1.FormattedValue")]        
        public string? FieldName{ get; set; }

In cases like this, I'm always getting the null values. There are regular values when I use the Postman.

Did anyone have same problem?

Aleksandar
  • 111
  • 7
  • According to the documentation for the OriginalName attribute which says: "Denotes the original name of a variable defined in metadata.". The properties like this are not a part of the metadata, maybe that's the reason. – Aleksandar Jun 28 '23 at 13:47
  • But you can get it through Postman, isn't it accessing data through OData when using Postman to call? – Chen Jun 29 '23 at 09:27
  • You cannot directly query this field using the OData annotation. You will get this property if you add "Prefer" http header and set the value to odata.include-annotations="OData.Community.Display.V1.FormattedValue". – Aleksandar Jun 30 '23 at 13:23

0 Answers0