File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 77namespace EntityChange ;
88
99/// <summary>
10- /// A class to compare two entities generating a change list.
10+ /// A class to compare two entities generating a change list.
1111/// </summary>
1212public class EntityComparer : IEntityComparer
1313{
@@ -54,6 +54,9 @@ public EntityComparer(IEntityConfiguration configuration)
5454 public IReadOnlyList < ChangeRecord > Compare < TEntity > ( TEntity original , TEntity current )
5555 {
5656 _changes . Clear ( ) ;
57+ _pathStack . Clear ( ) ;
58+ _memberStack . Clear ( ) ;
59+
5760 var type = typeof ( TEntity ) ;
5861
5962 CompareType ( type , original , current ) ;
@@ -427,10 +430,10 @@ private void CreateChange(
427430 {
428431 var currentMember = CurrentMember ( ) ;
429432 var propertyName = name ?? CurrentName ( ) ;
430- var displayName = currentMember . DisplayName ?? propertyName . ToSpacedWords ( ) ;
433+ var displayName = currentMember ? . DisplayName ?? propertyName . ToSpacedWords ( ) ;
431434 var currentPath = path ?? CurrentPath ( ) ;
432- var originalFormatted = FormatValue ( original , currentMember . Formatter ) ;
433- var currentFormatted = FormatValue ( current , currentMember . Formatter ) ;
435+ var originalFormatted = FormatValue ( original , currentMember ? . Formatter ) ;
436+ var currentFormatted = FormatValue ( current , currentMember ? . Formatter ) ;
434437
435438 var changeRecord = new ChangeRecord
436439 {
You can’t perform that action at this time.
0 commit comments