Browse Source

Update Storageable

pull/29/head
sunkaixuan 2 years ago
parent
commit
407de9638d
  1. 12
      Src/Asp.Net/SqlSugar/Abstract/SugarProvider/SqlSugarProvider.cs
  2. 8
      Src/Asp.Net/SqlSugar/Abstract/SugarProvider/SqlSugarScopeProvider.cs
  3. 2
      Src/Asp.Net/SqlSugar/Interface/ISqlSugarClient.cs
  4. 9
      Src/Asp.Net/SqlSugar/SqlSugarScope.cs

12
Src/Asp.Net/SqlSugar/Abstract/SugarProvider/SqlSugarProvider.cs

@ -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>();

8
Src/Asp.Net/SqlSugar/Abstract/SugarProvider/SqlSugarScopeProvider.cs

@ -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()
{

2
Src/Asp.Net/SqlSugar/Interface/ISqlSugarClient.cs

@ -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);

9
Src/Asp.Net/SqlSugar/SqlSugarScope.cs

@ -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);

Loading…
Cancel
Save