Skip to content

Commit 4e9ec50

Browse files
committed
Merge branch 'bugfix/SqlTopicRepository.Save-implicit-IsDirty' into develop
This resolves a bug in which attributes which had been reconfigured from extended to indexed storage weren't being saved by `SqlTopicRepository.Save()` unless the `Topic` was explicitly marked as `IsDirty()`. This fix ensures that topics that are _implicitly_ dirty due to `IsExtendedAttribute` mismatches are treated as `IsDirty()` as far as `Save()` is concerned. This was already supported for indexed attributes configured as extended attributes, but not the other way around. This resolves Issue #73.
2 parents ed1d124 + c272e52 commit 4e9ec50

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

OnTopic.Data.Sql/SqlTopicRepository.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,10 @@ bool persistRelationships
373373
| current command. A more aggressive version of this would wrap much of the below logic in this, but this is just meant
374374
| as a quick fix to reduce the overhead of recursive saves.
375375
\-----------------------------------------------------------------------------------------------------------------------*/
376-
areAttributesDirty = areAttributesDirty || extendedAttributeList.Any(a => a.IsExtendedAttribute == false);
376+
areAttributesDirty =
377+
areAttributesDirty ||
378+
indexedAttributeList.Any(a => a.IsExtendedAttribute == true) ||
379+
extendedAttributeList.Any(a => a.IsExtendedAttribute == false);
377380

378381
var isDirty =
379382
isTopicDirty ||

0 commit comments

Comments
 (0)