From 7ba802adbe9551fd9d84d0705171bb677b75f850 Mon Sep 17 00:00:00 2001 From: VitaliyCeban Date: Thu, 24 Nov 2022 10:41:23 +0200 Subject: [PATCH] Fixed SkipOnUpdate --- .../LinqToDB.EntityFrameworkCore/EFCoreMetadataReader.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/LinqToDB.EntityFrameworkCore/EFCoreMetadataReader.cs b/Source/LinqToDB.EntityFrameworkCore/EFCoreMetadataReader.cs index c41ebfa..09a136f 100644 --- a/Source/LinqToDB.EntityFrameworkCore/EFCoreMetadataReader.cs +++ b/Source/LinqToDB.EntityFrameworkCore/EFCoreMetadataReader.cs @@ -262,15 +262,16 @@ public T[] GetAttributes(Type type, MemberInfo memberInfo, bool inherit = tru } } - var behaviour = prop.GetBeforeSaveBehavior(); + var beforeSaveBehaviour = prop.GetBeforeSaveBehavior(); var skipOnInsert = prop.ValueGenerated.HasFlag(ValueGenerated.OnAdd); if (skipOnInsert) { - skipOnInsert = isIdentity || behaviour != PropertySaveBehavior.Save; + skipOnInsert = isIdentity || beforeSaveBehaviour != PropertySaveBehavior.Save; } - var skipOnUpdate = behaviour != PropertySaveBehavior.Save || + var afterSaveBehaviour = prop.GetAfterSaveBehavior(); + var skipOnUpdate = afterSaveBehaviour != PropertySaveBehavior.Save || prop.ValueGenerated.HasFlag(ValueGenerated.OnUpdate); return new T[]