Browse Source

Fix collection navigation entry comparison logic

pull/23329/head
maliming 1 year ago
parent
commit
c5ceb03e58
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 7
      framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ChangeTrackers/AbpEntityEntry.cs

7
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ChangeTrackers/AbpEntityEntry.cs

@ -1,4 +1,5 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
@ -51,8 +52,12 @@ public class AbpEntityEntry
continue; continue;
} }
if (navigationEntry.NavigationEntry is CollectionEntry && navigationEntry == entityEntryNavigationEntry) if (navigationEntry.NavigationEntry is CollectionEntry)
{ {
if (navigationEntry != entityEntryNavigationEntry)
{
continue;
}
navigationEntry.OriginalValue ??= new List<object>(); navigationEntry.OriginalValue ??= new List<object>();
var ls = navigationEntry.OriginalValue.As<List<object>>(); var ls = navigationEntry.OriginalValue.As<List<object>>();
ls.Add(entityEntry.Entity); ls.Add(entityEntry.Entity);

Loading…
Cancel
Save