mario.muja wrote:
Hi,
do entity objects generated by LLBLGen allow me to find out what has changed in a particular entity?
For example, what was the original value of an attribute and what is the current value?
Regards, Mario
Changes are tracked, per field. If you fetch an entity, say a customer, from the database, a field has 2 properties:
customer.Fields[index].DbValue contains the value from the db. This field will never change. If the entity is new, this field is null.
customer.Fields[index].CurrentValue contains the value for the field. When you change it, for example through customer.PropertyName, the flag customer.Fields[index].IsChanged is set.
You can save fields if you want to, and rollback to that state later on. See "Unit of work and field data versioning" in the documentation for details. Transaction rollbacks use this too for example, so when a save of multiple entities first fetches back the Identity value for a saved entity and later on another entity causes the failure of the transaction and everything is rolled back, the fields of all participating entities are rolled back to the state right before the transaction started.