Skip to content

Commit

Permalink
ChangesLogRepository: Fix NRE (#757)
Browse files Browse the repository at this point in the history
  • Loading branch information
i-rakityanskiy authored Jul 14, 2022
1 parent d07ed38 commit d797f1b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ public ICollection<ChangesLog> AddChangesLogToDbContext<TEntity>(
{
var properties = entityEntry.Properties
.Where(p => p.IsModified
&& trackedProperties.Contains(p.Metadata.PropertyInfo.Name))
.Select(x => (x.Metadata.PropertyInfo.Name,
&& trackedProperties.Contains(p.Metadata.Name))
.Select(x => (x.Metadata.Name,
valueProjector(x.Metadata.ClrType, x.OriginalValue),
valueProjector(x.Metadata.ClrType, x.CurrentValue)));

var references = entityEntry.References
.Where(x => trackedProperties.Contains(x.Metadata.PropertyInfo.Name)
.Where(x => trackedProperties.Contains(x.Metadata.Name)
&& x.TargetEntry?.State == EntityState.Modified)
.Select(x => (x.Metadata.PropertyInfo.Name,
.Select(x => (x.Metadata.Name,
valueProjector(x.TargetEntry.Metadata.ClrType, x.TargetEntry.OriginalValues.ToObject()),
valueProjector(x.TargetEntry.Metadata.ClrType, x.TargetEntry.CurrentValues.ToObject())));

Expand Down

0 comments on commit d797f1b

Please sign in to comment.