Browse Source

Update Oracle batch updates

pull/8/head
sunkaixuna 3 years ago
parent
commit
91970743d1
  1. 2
      Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs
  2. 17
      Src/Asp.Net/SqlSugar/Realization/Oracle/Updateable/OracleUpdateable.cs

2
Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

@ -66,7 +66,7 @@ namespace SqlSugar
{
return this.ExecuteCommand() > 0;
}
public async Task<int> ExecuteCommandAsync()
public virtual async Task<int> ExecuteCommandAsync()
{
string sql = _ExecuteCommand();
if (string.IsNullOrEmpty(sql))

17
Src/Asp.Net/SqlSugar/Realization/Oracle/Updateable/OracleUpdateable.cs

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SqlSugar
{
@ -27,5 +28,21 @@ namespace SqlSugar
return base.UpdateObjs.Count();
}
}
public async override Task<int> ExecuteCommandAsync()
{
if (base.UpdateObjs.Count() == 1)
{
return await base.ExecuteCommandAsync();
}
else if (base.UpdateObjs.Count() == 0)
{
return 0;
}
else
{
await base.ExecuteCommandAsync();
return base.UpdateObjs.Count();
}
}
}
}

Loading…
Cancel
Save