mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-27 16:50:33 +08:00
Add: db.Storageabl(data).ExecuteSqlBulkCopy()
This commit is contained in:
@@ -107,6 +107,16 @@ namespace SqlSugar
|
||||
result +=await x.AsUpdateable.ExecuteCommandAsync();
|
||||
return result;
|
||||
}
|
||||
public int ExecuteSqlBulkCopy()
|
||||
{
|
||||
var storage = this.ToStorage();
|
||||
return storage.BulkCopy() + storage.BulkUpdate();
|
||||
}
|
||||
public async Task<int> ExecuteSqlBulkCopyAsync()
|
||||
{
|
||||
var storage =await this.ToStorageAsync();
|
||||
return await storage.BulkCopyAsync() + await storage.BulkUpdateAsync();
|
||||
}
|
||||
public StorageableResult<T> ToStorage()
|
||||
{
|
||||
if (whereFuncs == null || whereFuncs.Count == 0)
|
||||
|
||||
@@ -27,6 +27,8 @@ namespace SqlSugar
|
||||
IStorageable<T> As(string tableName);
|
||||
int ExecuteCommand();
|
||||
Task<int> ExecuteCommandAsync();
|
||||
int ExecuteSqlBulkCopy();
|
||||
Task<int> ExecuteSqlBulkCopyAsync();
|
||||
}
|
||||
|
||||
public class StorageableInfo<T> where T : class, new()
|
||||
|
||||
Reference in New Issue
Block a user