Skip to content

Commit 4f4de2d

Browse files
Merge pull request #2446 from rockfordlhotka/v5.5.1-pre
Fix undo issue for lazy loaded property values
2 parents d5602f4 + d07ae88 commit 4f4de2d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Source/Csla.Shared/Core/FieldManager/FieldDataManager.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,13 @@ void Core.IUndoableObject.UndoChanges(int parentEditLevel, bool parentBindingEdi
551551
if (undoable != null)
552552
{
553553
// current value is undoable
554-
if (oldItem != null)
554+
var doUndo = (oldItem != null);
555+
if (!doUndo)
556+
{
557+
var propInfo = _propertyList.Where(r => r.Index == index).First();
558+
doUndo = propInfo.RelationshipType.HasFlag(RelationshipTypes.LazyLoad);
559+
}
560+
if (doUndo)
555561
undoable.UndoChanges(parentEditLevel, parentBindingEdit);
556562
else
557563
_fieldData[index] = null;

releasenotes.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ CSLA 5 includes major enhancements, and brings support for .NET Core 3.1, .NET 5
66

77
Bug fixes over the 5.5.0 release.
88

9-
[Changes in this release](https://github.com/MarimerLLC/csla/issues?q=is%3Aissue+is%3Aclosed+project%3AMarimerLLC%2Fcsla%2F24)
9+
## Change List
10+
11+
[Changes in this release](https://github.com/MarimerLLC/csla/issues?q=project%3AMarimerLLC%2Fcsla%2F24+is%3Aclosed+)
1012

1113
## Contributors
1214

13-
* [@michaelcsikos](https://github.com/michaelcsikos)
14-
* [@ProDInfo](https://github.com/ProDInfo)
15-
* [@JacoJordaan](https://github.com/JacoJordaan)
15+
* [@RaviPatelTheOne](https://github.com/RaviPatelTheOne)
16+
* [@amselem](https://github.com/amselem)
1617
* [@rockfordlhotka](https://github.com/rockfordlhotka)
1718

1819
# CSLA .NET version 5.5.0 release

0 commit comments

Comments
 (0)