From 378c6dff13189228e6a6ed94b860735c4253e4cc Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 5 Nov 2025 16:41:07 +0800 Subject: [PATCH] Audit only modified properties in DbContext Fix the merge problem. --- .../Volo/Abp/EntityFrameworkCore/AbpDbContext.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs index 5af4452dd1..4b79bf017c 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs @@ -442,6 +442,7 @@ public abstract class AbpDbContext : DbContext, IAbpEfCoreDbContext, break; } + var modifiedProperties = entry.Properties.Where(x => x.IsModified).ToList(); var disableAuditingAttributes = modifiedProperties.Select(x => x.Metadata.PropertyInfo?.GetCustomAttribute()).ToList(); if (disableAuditingAttributes.Any(x => x == null || x.UpdateModificationProps)) {