aspnet / JsonPatch

[Archived] JSON PATCH library. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
103 stars 48 forks source link

Patching of records (readonly entities) fails #119

Closed MovGP0 closed 6 years ago

MovGP0 commented 7 years ago

The following code does not work on readonly entities:

patch.ApplyTo(readonlyentity);

It should be possible to do something like this:

var patchedentity = patch.ApplyTo(readonlyentity);
MovGP0 commented 7 years ago

One way of doing this would be to convert the readonly entity to an Newtonsoft.Json.Linq.JObject, apply the patches, and deserialize to the original datatype.

aspnet-hello commented 6 years ago

This issue was moved to aspnet/Home#2426