Browse Source

Add TruncateTable<T,T2,T3,T4>

pull/17/head
sunkaixuan 3 years ago
parent
commit
fd85f67fd7
  1. 21
      Src/Asp.Net/SqlSugar/Abstract/DbMaintenanceProvider/Methods.cs
  2. 3
      Src/Asp.Net/SqlSugar/Interface/IDbMaintenance.cs

21
Src/Asp.Net/SqlSugar/Abstract/DbMaintenanceProvider/Methods.cs

@ -220,6 +220,27 @@ namespace SqlSugar
this.Context.InitMappingInfo<T>();
return this.TruncateTable(this.Context.EntityMaintenance.GetEntityInfo<T>().DbTableName);
}
public virtual bool TruncateTable<T,T2>()
{
TruncateTable<T>();
TruncateTable<T2>();
return true;
}
public virtual bool TruncateTable<T, T2,T3>()
{
TruncateTable<T>();
TruncateTable<T2>();
TruncateTable<T3>();
return true;
}
public virtual bool TruncateTable<T, T2, T3,T4>()
{
TruncateTable<T>();
TruncateTable<T2>();
TruncateTable<T3>();
TruncateTable<T4>();
return true;
}
public virtual bool DropColumn(string tableName, string columnName)
{
columnName = this.SqlBuilder.GetTranslationColumnName(columnName);

3
Src/Asp.Net/SqlSugar/Interface/IDbMaintenance.cs

@ -33,6 +33,9 @@ namespace SqlSugar
bool DropTable(string tableName);
bool TruncateTable(string tableName);
bool TruncateTable<T>();
bool TruncateTable<T,T2>();
bool TruncateTable<T, T2, T3>();
bool TruncateTable<T, T2, T3,T4>();
bool CreateTable(string tableName, List<DbColumnInfo> columns,bool isCreatePrimaryKey=true);
bool AddColumn(string tableName, DbColumnInfo column);
bool UpdateColumn(string tableName, DbColumnInfo column);

Loading…
Cancel
Save