Hi,
LLBLGen Version 4.0.0.0.
I received a bug report with an ORMEntityOutOfSyncException. This exception contains an OutOfSyncEntity, which I suppose is the entity that generated the error.
Our error handling code prints out several properties of the exception and of the exception's OutOfSyncEntity:
SD.LLBLGen.Pro.ORMSupportClasses.ORMEntityOutOfSyncException
Message: The entity is out of sync with its data in the database. Refetch this entity before using this in-memory instance.
Source: SD.LLBLGen.Pro.ORMSupportClasses
TargetSite: System.Object GetValue(Int32, Boolean)
LLBLGen RuntimeBuild: 06062013
LLBLGen RuntimeVersion: 4.0.0.0
OutOfSyncEntity:
IsNew: False
IsDirty: False
Fields:
IsDirty: False
State: Fetched
Fields List:
EntityField2:
Name: TDocument_Id
IsChanged: False
IsNull: False
CurrentValue: 96405
DbValue: 96405
...
I do not understand why the ORMEntityOutOfSyncException is raised, since everything indicates that the entity is good.
I would like to be able to test whether the Entity is OutOfSync before accessing any properties. Currently I'm testing IsNew and Fields.State. But that does not seem to be sufficient.
Any help would be appreciated.
Thanks!