Browse Source
Remove unnecessary `NavigationEntry` parameter.
pull/19559/head
maliming
3 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
2 changed files with
4 additions and
7 deletions
-
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ChangeTrackers/AbpEfCoreNavigationHelper.cs
-
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/EntityHistory/EntityHistoryHelper.cs
|
|
|
@ -156,7 +156,7 @@ public class AbpEfCoreNavigationHelper : ITransientDependency |
|
|
|
return EntityEntries.TryGetValue(entryId, out var abpEntityEntry) && abpEntityEntry.IsModified; |
|
|
|
} |
|
|
|
|
|
|
|
public virtual bool IsNavigationEntryModified(EntityEntry entityEntry, NavigationEntry navigationEntry, int index) |
|
|
|
public virtual bool IsNavigationEntryModified(EntityEntry entityEntry, int navigationEntryIndex) |
|
|
|
{ |
|
|
|
var entryId = GetEntityId(entityEntry); |
|
|
|
if (entryId == null) |
|
|
|
@ -169,7 +169,7 @@ public class AbpEfCoreNavigationHelper : ITransientDependency |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
var navigationEntryProperty = abpEntityEntry.NavigationEntries.ElementAtOrDefault(index); |
|
|
|
var navigationEntryProperty = abpEntityEntry.NavigationEntries.ElementAtOrDefault(navigationEntryIndex); |
|
|
|
return navigationEntryProperty != null && navigationEntryProperty.IsModified; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -195,10 +195,9 @@ public class EntityHistoryHelper : IEntityHistoryHelper, ITransientDependency |
|
|
|
|
|
|
|
if (Options.SaveEntityHistoryWhenNavigationChanges && AbpEfCoreNavigationHelper != null) |
|
|
|
{ |
|
|
|
var index = 0; |
|
|
|
foreach (var navigationEntry in entityEntry.Navigations) |
|
|
|
foreach (var (navigationEntry, index) in entityEntry.Navigations.Select((value, i) => ( value, i ))) |
|
|
|
{ |
|
|
|
if (AbpEfCoreNavigationHelper.IsNavigationEntryModified(entityEntry, navigationEntry, index)) |
|
|
|
if (AbpEfCoreNavigationHelper.IsNavigationEntryModified(entityEntry, index)) |
|
|
|
{ |
|
|
|
propertyChanges.Add(new EntityPropertyChangeInfo |
|
|
|
{ |
|
|
|
@ -206,8 +205,6 @@ public class EntityHistoryHelper : IEntityHistoryHelper, ITransientDependency |
|
|
|
PropertyTypeFullName = navigationEntry.Metadata.ClrType.GetFirstGenericArgumentIfNullable().FullName! |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
index++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|