IsDirty set to true after load #1668
-
I am having an awful time with the isDirty flag being set to true even when using BypassPropertyChecks and ((ICheckRules)obj).SuppressRuleChecking(); in the same method! I'm using a factory class that uses Automapper to map from the data source to my BO.
Here is the status at the MarkOld(obj) line:
For the last 6 hours I have tried a number of permutations and I still can't get it to work. Does anyone have any ideas on what I should do. I'm really thinking of using reflection to change the isDirty flag back to false. But I loath hacks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
When is |
Beta Was this translation helpful? Give feedback.
-
Awesome clue! I got it (Irish jig). Because I use .include(s) in my entity framework queries, I figured out that I'm responsible for checking the object graph to set the retrieved values as MarkOld(). When I found the code table that was loaded, and set the property, all is well! Thank you so much for that clue :-) |
Beta Was this translation helpful? Give feedback.
When is
IsDirty
(andIsSelfDirty
?) set as true? At the bottom of your factory method, or after the data portal returns, or somewhere else?