0

This is a follow up to this question: Replacement of Self-tracking entities in Entity Framework 6

I'm starting a new project with EF6 and read the above question and answer. Unless I'm missing something, it seems odd to me that Microsoft would drop support for something seemingly so important as self-tracking entities. By dropping support, Microsoft has effectively left people to figure out how to solve the important matter of tracking/persisting entity state. As EF keep getting better, I would think that entity-tracking is a feature that would be added, not removed...

I understand that there is an apparently very good open-source product ("Self-Tracking Entities") I believe was single-handedly written by a very talented individual (Anthony Sneed), but it is difficult for me to judge how stable this product is and what kind of support it offers, especially because entity-tracking is going to be a non-trivial feature in my design. I don't expect any product to be perfect but I also can't risk adopting a product I discover later is buggy or has poor technical support.

Are there any commercial alternatives? What are the experienced EF developers using to track entities (do most people end up writing their own tracking code)? What is considered best-practice in tracking entities in EF6?

Thank you.

Community
  • 1
  • 1
Jazimov
  • 12,626
  • 9
  • 52
  • 59
  • STE templates are still available and they work with EF6. It is supported still (just not recommended) - https://visualstudiogallery.msdn.microsoft.com/a3ac10a5-9365-4096-bb58-d9a1ba71db8f – EkoostikMartin Oct 20 '14 at 15:39
  • Thank you for this information. However, ideally, I'd like to know what is recommended rather than what is not recommended. – Jazimov Oct 20 '14 at 15:53
  • It's recommended that you design your software to not need/use STEs. Since you have not listed any specifics in your question, it's impossible to provide an adequate alternative. – EkoostikMartin Oct 20 '14 at 15:57
  • I fail to see how "specifics" would be needed: Tracking changes (deletes, additions, modifications) to entities is a very generic requirement and probably every EF project has this requirement. What specifics would you need to know that would help you offer ideas for tracking changes to entities in an EF6 project? – Jazimov Oct 20 '14 at 16:30
  • There is a difference between tracking changes to entities (which can be done via an ObjectContext/DbContext) and self tracking entities. I have done 10+ projects using EF (since EF 3) and have never needed to use STEs. I have used WCF DataServices / WebAPI for simple CRUD services to do small atomic commits (for simple projects) and also complex tracking modeled via typical DDD methods (bounded context / aggregate root). Honestly STEs are a just a bad design in general, as you should not be sharing a tightly coupled data model across physical/logical application boundaries. – EkoostikMartin Oct 20 '14 at 18:05
  • That helps. My confusion was (is?) "self-tracking" versus "tracking". I obviously need to better understand how changes are "tracked"/"trackable" using the included EF features. If you or anyone else could help give me a final nudge in the right direction for change-tracking using EF features/best-practices, I would be grateful (remember, I'm new to EF). – Jazimov Oct 20 '14 at 19:22

0 Answers0