Skip to content

EdmDeltaEntityObject serialization issue#67

Open
vasrinwork wants to merge 3 commits intoxuzhg:mainfrom
vasrinwork:user/vasrin/serialization_delta
Open

EdmDeltaEntityObject serialization issue#67
vasrinwork wants to merge 3 commits intoxuzhg:mainfrom
vasrinwork:user/vasrin/serialization_delta

Conversation

@vasrinwork
Copy link

@vasrinwork vasrinwork commented Nov 11, 2025

This PR introduces a new EntitySet History:

**History** { string Id, string CustomerDelta }

where customerDelta is the serialized format of EdmEntityDeltaObject representation of Customer model.

On using a custom serialization technique, we see the below response for the GET History API:
Actual Response:

{
  "@context": "http://localhost:5048/odata/$metadata#History",
  "value": [
    {
      "Id": 1,
      "CustomerDelta": "{\"Id\":1,\"Name\":\"customer old name\",\"Orders\":[{\"Id\":1},{\"Id\":2},{\"Id\":1,\"Amount\":8,\"Items\":[{\"Id\":1}]}]}"
    }
  ]
}

Expected Response:

{
    "@context": "http://localhost:5048/odata/$metadata#History",
    "value": [
        {
            "Id": 1,
            "CustomerDelta": {
                "Id": 1,
                "Name": "customer old name",
                "Orders@delta": [
                    {
                        "Id": 1
                    },
                    {
                        "@removed": {
                            "reason": "deleted"
                        },
                        "@id": "http://tempuri.org/Orders(2)",
                        "Id": 2,
                        "Amount": 0
                    },
                    {
                        "Id": 1,
                        "Amount": 8,
                        "Items@delta": [
                            {
                            "Id": 1
                            }
                        ]
                    }
                ]
            }
        }
    ]
}

The serialization logic we used here omits the annotations/metadata like @removed, @context, @delta, etc.
We are trying to figure out if odata library provides any custom serialization methods that can convert the EdmDeltaEntityObject to a string, retaining the metadata and the annotations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant