0

I need to keep track of new rows that are added to a table. Is there any way to detect what rows were created as a result of me calling the Create() method for an entity (in other words, rows that I programatically inserted in the code)? I know I could manually keep track of what was added, but does Entity framework already know this and if so how do I detect the new changes?

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
Andrew
  • 1,581
  • 3
  • 18
  • 31
  • The words that would help you solve this are *change tracking*. There are a plethora of articles available talking about *entity framework change tracking*. – Erik Philips Nov 19 '15 at 18:55
  • Possible duplicate of [Entity Framework 6: audit/track changes](http://stackoverflow.com/questions/26355486/entity-framework-6-audit-track-changes) – austin wernli Nov 19 '15 at 18:58
  • You really should keep track manually instead of relying on EF tracking that. The more code there is in your app there more potential there is for confusion when relying on global state like that. This would create a lot of coupling. – usr Nov 19 '15 at 19:17

0 Answers0