mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-01-19 17:51:36 +08:00
Add Saveable async methods
This commit is contained in:
@@ -80,6 +80,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Core
|
||||||
public int ExecuteCommand()
|
public int ExecuteCommand()
|
||||||
{
|
{
|
||||||
LoadInsertable();
|
LoadInsertable();
|
||||||
@@ -118,6 +119,23 @@ namespace SqlSugar
|
|||||||
updateable.ExecuteCommand();
|
updateable.ExecuteCommand();
|
||||||
return saveObjects;
|
return saveObjects;
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
#region Core Async
|
||||||
|
public Task<int> ExecuteCommandAsync()
|
||||||
|
{
|
||||||
|
return Task.FromResult(ExecuteCommand());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<T> ExecuteReturnEntityAsync()
|
||||||
|
{
|
||||||
|
return Task.FromResult(ExecuteReturnEntity());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<List<T>> ExecuteReturnListAsync()
|
||||||
|
{
|
||||||
|
return Task.FromResult(ExecuteReturnList());
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
public ISaveable<T> InsertColumns(Expression<Func<T, object>> columns)
|
public ISaveable<T> InsertColumns(Expression<Func<T, object>> columns)
|
||||||
{
|
{
|
||||||
LoadInsertable();
|
LoadInsertable();
|
||||||
|
|||||||
@@ -3,11 +3,16 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace SqlSugar
|
namespace SqlSugar
|
||||||
{
|
{
|
||||||
public partial interface ISaveable<T> where T : class, new()
|
public partial interface ISaveable<T> where T : class, new()
|
||||||
{
|
{
|
||||||
|
Task<int> ExecuteCommandAsync();
|
||||||
|
Task<T> ExecuteReturnEntityAsync();
|
||||||
|
|
||||||
|
Task<List<T>> ExecuteReturnListAsync();
|
||||||
int ExecuteCommand();
|
int ExecuteCommand();
|
||||||
T ExecuteReturnEntity();
|
T ExecuteReturnEntity();
|
||||||
List<T> ExecuteReturnList();
|
List<T> ExecuteReturnList();
|
||||||
|
|||||||
Reference in New Issue
Block a user