From 9cd87c05e0eab2f6e241129b976057c51816c5f2 Mon Sep 17 00:00:00 2001 From: Christopher Jolly Date: Mon, 1 Jan 2024 01:06:13 +0800 Subject: [PATCH] We need to mark the query getting the affected number of rows as returning a result set that contains a row with the number of affected rows from the previous operation. Without it, the result would be read from the row count of the current SELECT --- src/EFCore.Jet/Update/Internal/JetUpdateSqlGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EFCore.Jet/Update/Internal/JetUpdateSqlGenerator.cs b/src/EFCore.Jet/Update/Internal/JetUpdateSqlGenerator.cs index 8fef9f1..46e59f5 100644 --- a/src/EFCore.Jet/Update/Internal/JetUpdateSqlGenerator.cs +++ b/src/EFCore.Jet/Update/Internal/JetUpdateSqlGenerator.cs @@ -116,7 +116,7 @@ namespace EntityFrameworkCore.Jet.Update.Internal .Append(SqlGenerationHelper.StatementTerminator).AppendLine() .AppendLine(); - return ResultSetMapping.LastInResultSet; + return ResultSetMapping.LastInResultSet | ResultSetMapping.ResultSetWithRowsAffectedOnly; } //If multiple columns were output, the SQL Server behavior is to produce a INSERT INTO ... OUTPUT statement