Search code examples
serializationasp.net-web-apiodata

Serializing Delta<T> to JSON


I have an API PATCH endpoint that receives a Delta<T> and I need to serialize it, put it on a queue, and deserialize it in another process.

Using JsonConvert.SerializeObject returns {}. The incoming Delta<T> looks like it's correctly formed.

Any idea why Delta<T> is serializing to an empty JSON object?

UPDATE

  • Using System.Web.OData.Delta<T> gives me {}.
  • Using System.Web.Http.OData.Delta<T> gives me a full serialization of T, including unchanged properties.

Solution

    • Using System.Web.OData.Delta<T> gives me {}.
    • Using System.Web.Http.OData.Delta<T> gives me a full serialization of T, including unchanged properties.