mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Add Saveable async methods
This commit is contained in:
parent
83812c9d52
commit
566e75fe67
@ -80,6 +80,7 @@ namespace SqlSugar
|
||||
}
|
||||
}
|
||||
|
||||
#region Core
|
||||
public int ExecuteCommand()
|
||||
{
|
||||
LoadInsertable();
|
||||
@ -118,6 +119,23 @@ namespace SqlSugar
|
||||
updateable.ExecuteCommand();
|
||||
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)
|
||||
{
|
||||
LoadInsertable();
|
||||
|
@ -3,11 +3,16 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public partial interface ISaveable<T> where T : class, new()
|
||||
{
|
||||
Task<int> ExecuteCommandAsync();
|
||||
Task<T> ExecuteReturnEntityAsync();
|
||||
|
||||
Task<List<T>> ExecuteReturnListAsync();
|
||||
int ExecuteCommand();
|
||||
T ExecuteReturnEntity();
|
||||
List<T> ExecuteReturnList();
|
||||
|
Loading…
Reference in New Issue
Block a user