Open roji opened 4 years ago
Hi @roji, Will there be an update for this in the near future?
@MarshalOfficial not at the moment, this is in the backlog and there are more important things happening for 7.0. Note that it's really easy to do this yourself in your application - simply set up the comparer yourself (EF docs) (that's one reason why I haven't prioritized it yet).
@MarshalOfficial not at the moment, this is in the backlog and there are more important things happening for 7.0. Note that it's really easy to do this yourself in your application - simply set up the comparer yourself (EF docs) (that's one reason why I haven't prioritized it yet).
Yes, you are right. When I think about performance overhead, I come to the conclusion that handling this issue is not a difficult task.
var obj = await _dbContext.json_table.FirstOrDefaultAsync(a => a.id == id);
obj.child_data.some_property = new_value;
_dbContext.Entry(obj).Property(e => e.child_data).IsModified = true;
await _dbContext.SaveChangesAsync();
Yes, manually telling EF when the property has changed is certainly more efficient than having it compare deep JSON documents each time SaveChanges is called.
But require users to set it up explicitly, since this can be very heavy perf-wise.
Raised in https://stackoverflow.com/questions/62021228/entity-framework-not-detecting-jsonb-properties-changes-in-c-sharp