EntityFramework.Utilities icon indicating copy to clipboard operation
EntityFramework.Utilities copied to clipboard

How can I get the changed fields with EFBatchOperation?

Open winsonet opened this issue 8 years ago • 3 comments

normal I can use ChangeTracker.Entries() for get the current changed fields, but when I use EFBatchOperation, it's seems not run the EntityFramework's on SaveChanges event, so I don't know how can I get the changed values :(

thanks!

winsonet avatar Apr 14 '16 10:04 winsonet

EFBatchOperation actions generate sql statements to directly perform the requested actions (Bulk insert for insert all for example). Because of this EF does not track the changes since the changes happen out side of EF. It would be just like some one going through Sql Server Management Studio and running an insert or update statement. In order to get the changes you would need to reload the entities with entity framework.

RubberChickenParadise avatar Apr 14 '16 12:04 RubberChickenParadise

hum....after I review your source code, I also know about it, thanks!!

winsonet avatar Apr 14 '16 13:04 winsonet

I added feature request #80 that might fix this... does this sound like something that would be desirable?

ewassef avatar Apr 20 '16 00:04 ewassef