How can we improve Entity Framework Core?

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.

214 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Mike Flasko shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    Closing as we are changing the focus of this UserVoice site to be about EF Core and POCO proxies are not implemented there.

    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.

    4 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Jon commented  ·   ·  Flag as inappropriate

        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.

      • Anonymous commented  ·   ·  Flag as inappropriate

        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.

      • Anonymous commented  ·   ·  Flag as inappropriate

        I'd like to be able to all properties that change. GetModifiedProperties() returns all the properties modified or not.

      Feedback and Knowledge Base