From 12cdbf24ba858b0584ac165cc1482c486964c997 Mon Sep 17 00:00:00 2001 From: sunkaixuna <610262374@qq.com> Date: Wed, 22 Dec 2021 13:06:40 +0800 Subject: [PATCH] Oracle ExecommandAsync -1 bug --- Src/Asp.Net/OracleTest/UnitTest/Updateable.cs | 11 +++++++++++ .../Realization/Oracle/Updateable/OracleUpdateable.cs | 10 +++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/OracleTest/UnitTest/Updateable.cs b/Src/Asp.Net/OracleTest/UnitTest/Updateable.cs index de6098300..f71d525d1 100644 --- a/Src/Asp.Net/OracleTest/UnitTest/Updateable.cs +++ b/Src/Asp.Net/OracleTest/UnitTest/Updateable.cs @@ -59,6 +59,17 @@ namespace OrmTest new UnitGuidTest() { Id = Guid.NewGuid(),name= "a" } }).ExecuteCommand(); + var updateObjs = new List { + new Order() { Id = 11, Name = "order11" } + }; + + //update all columns by primary key + + if (Db.Updateable(updateObjs).ExecuteCommandAsync().GetAwaiter().GetResult() != 1) + { + throw new Exception("unit error"); + } + } } public class UnitGuidTest diff --git a/Src/Asp.Net/SqlSugar/Realization/Oracle/Updateable/OracleUpdateable.cs b/Src/Asp.Net/SqlSugar/Realization/Oracle/Updateable/OracleUpdateable.cs index 560dc8815..aff254a52 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Oracle/Updateable/OracleUpdateable.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Oracle/Updateable/OracleUpdateable.cs @@ -40,7 +40,15 @@ namespace SqlSugar { if (base.UpdateObjs.Count() == 1) { - return await base.ExecuteCommandAsync(); + var result= await base.ExecuteCommandAsync(); + if (result == -1) + { + return 1; + } + else + { + return result; + } } else if (base.UpdateObjs.Count() == 0) {