Update Storageable

This commit is contained in:
sunkaixuan
2022-12-01 00:21:56 +08:00
parent e616cd1a5a
commit 407de9638d
4 changed files with 30 additions and 1 deletions

View File

@@ -833,6 +833,18 @@ namespace SqlSugar
{
return new SaveableProvider<T>(this, saveObject);
}
public StorageableDataTable Storageable(List<Dictionary<string, object>> dictionaryList, string tableName)
{
DataTable dt = this.Context.Utilities.DictionaryListToDataTable(dictionaryList);
dt.TableName = tableName;
return this.Context.Storageable(dt);
}
public StorageableDataTable Storageable(Dictionary<string, object> dictionary, string tableName)
{
DataTable dt = this.Context.Utilities.DictionaryListToDataTable(new List<Dictionary<string, object>>() { dictionary });
dt.TableName = tableName;
return this.Context.Storageable(dt);
}
public IStorageable<T> Storageable<T>(List<T> dataList) where T : class, new()
{
this.InitMappingInfo<T>();

View File

@@ -566,6 +566,14 @@ namespace SqlSugar
{
return ScopedContext.SqlQueryable<T>(sql);
}
public StorageableDataTable Storageable(List<Dictionary<string, object>> dictionaryList, string tableName)
{
return ScopedContext.Storageable(dictionaryList, tableName);
}
public StorageableDataTable Storageable(Dictionary<string, object> dictionary, string tableName)
{
return ScopedContext.Storageable(dictionary, tableName);
}
public IStorageable<T> Storageable<T>(List<T> dataList) where T : class, new()
{

View File

@@ -137,6 +137,8 @@ namespace SqlSugar
#endregion
#region Saveable
StorageableDataTable Storageable(List<Dictionary<string, object>> dictionaryList, string tableName);
StorageableDataTable Storageable(Dictionary<string, object> dictionary, string tableName);
IStorageable<T> Storageable<T>(List<T> dataList) where T : class, new();
IStorageable<T> Storageable<T>(T data) where T : class, new();
StorageableDataTable Storageable(DataTable data);

View File

@@ -569,7 +569,14 @@ namespace SqlSugar
{
return ScopedContext.SqlQueryable<T>(sql);
}
public StorageableDataTable Storageable(List<Dictionary<string, object>> dictionaryList, string tableName)
{
return ScopedContext.Storageable(dictionaryList, tableName);
}
public StorageableDataTable Storageable(Dictionary<string, object> dictionary, string tableName)
{
return ScopedContext.Storageable(dictionary, tableName);
}
public IStorageable<T> Storageable<T>(List<T> dataList) where T : class, new()
{
return ScopedContext.Storageable(dataList);