You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EFCore.PG has its own JSON mapping mode, which is distinct from EF's JSON support (currently via owned entities and ToJson). When using this mode, EF doesn't automatically detect changes: one has to manually tell EF that a property changed (with ctx.Entry(foo).Property(b => b.Bar).IsModified = true).
In the past, one argument to not do automatic change tracking was performance: JSON documents are arbitrarily large, and so we'd have to perform a deep comparison of those object graphs. However, this is what EF does when mapping with ToJson, so that doesn't seem like a good argument.
A better reason to not go into this, is that there's no good/standard way to actually do deep object graph comparison in .NET - we'd have to use reflection to walk the object graph (that's even slower), and be careful to look only at the properties that EF actually cares about, etc. This is probably in itself unfeasible for POCO mapping.
However, we also support DOM mapping, where users map JsonDocument/JsonElement. In those mode we should be able to perform deep comparison; DOM mapping is also much more relevant, since EFCore.PG's POCO mapping is basically deprecated now that we have EF's ToJson support.
EFCore.PG has its own JSON mapping mode, which is distinct from EF's JSON support (currently via owned entities and ToJson). When using this mode, EF doesn't automatically detect changes: one has to manually tell EF that a property changed (with
ctx.Entry(foo).Property(b => b.Bar).IsModified = true
).In the past, one argument to not do automatic change tracking was performance: JSON documents are arbitrarily large, and so we'd have to perform a deep comparison of those object graphs. However, this is what EF does when mapping with ToJson, so that doesn't seem like a good argument.
A better reason to not go into this, is that there's no good/standard way to actually do deep object graph comparison in .NET - we'd have to use reflection to walk the object graph (that's even slower), and be careful to look only at the properties that EF actually cares about, etc. This is probably in itself unfeasible for POCO mapping.
However, we also support DOM mapping, where users map JsonDocument/JsonElement. In those mode we should be able to perform deep comparison; DOM mapping is also much more relevant, since EFCore.PG's POCO mapping is basically deprecated now that we have EF's ToJson support.
Previous reports: #1228, #1168, #3312
The text was updated successfully, but these errors were encountered: