Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does entity framework track changes on POCOs

Does the entity framework 4.0 track changes on Plain old C# object?

If so, should my class do something special (implement an interface/raise events when changing the value of a property?)

Also, how can I get the state(modified/unchanged, etc) of a POCO? Is there a way to know the "old" values of properties?

like image 927
tom greene Avatar asked Feb 11 '26 07:02

tom greene


1 Answers

I found POCO in the Entity Framework: Part 1 - The Experience by quick googling. See Part 3 – Change Tracking with POCO.

There are two types of change tracking possibilities with POCO: Snapshot based Change Tracking and Notification based Change Tracking with Proxies. In this post, I would like to drill into both options a bit further and cover the advantages and disadvantages of both, along with the implications of using either approach.

like image 81
Eugene Yokota Avatar answered Feb 18 '26 13:02

Eugene Yokota



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!