Detect only properties that actually changed with change tracking POCO proxies
I've noticed that in the proxied poco classes, an entity is marked as modified whenever a property is set, regardless of whether the value has actually changed. I think it would be nicer if only truly modified entities are flagged as modified.
This is something we can consider in EF Core if at some point we implement change tracking proxies.
From the EF6 perspective we don’t plan to change the current behavior. An important part of the motivation to create change tracking proxies is to avoid the cost of performing data comparisons.
@Jon that is when proxies (or some other way of rewriting the user provided code) could help, and we currently don't have proxies for EF Core, but that is a completely separate feature request from what this was about.
Personally, I don't like the solution of having to use INotifyPropertyChanged. That means that you can't use auto properties for succinctness, thus massively increasing the size of your entity classes if you have a lot of properties. If you don't use that, then, it's using snapshot, which of course uses lots of memory and is slow. Previously, I found that code first was slower than EF 5. So, now you get to put tons more boiler plate code in your classes or, things are slower. I've given up on the idea of having EF work with anything except a very small number of objects. The sad thing is that I've had better success with other ORMs like Hibernate in this regard.
In EF6 if you set the same property value again and again, the entity won't be marked as dirty!
I'd like to be able to all properties that change. GetModifiedProperties() returns all the properties modified or not - can be achieved by code.
I'd like to be able to all properties that change. GetModifiedProperties() returns all the properties modified or not.