mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 04:23:47 +08:00
Add DropTable<T1-T4>
This commit is contained in:
@@ -253,7 +253,32 @@ namespace SqlSugar
|
|||||||
this.Context.Ado.ExecuteCommand(string.Format(this.DropTableSql, tableName));
|
this.Context.Ado.ExecuteCommand(string.Format(this.DropTableSql, tableName));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
public virtual bool DropTable<T>()
|
||||||
|
{
|
||||||
|
var tableName= this.Context.EntityMaintenance.GetTableName<T>();
|
||||||
|
return DropTable(tableName);
|
||||||
|
}
|
||||||
|
public virtual bool DropTable<T,T2>()
|
||||||
|
{
|
||||||
|
DropTable<T>();
|
||||||
|
DropTable<T2>();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public virtual bool DropTable<T, T2,T3>()
|
||||||
|
{
|
||||||
|
DropTable<T>();
|
||||||
|
DropTable<T2>();
|
||||||
|
DropTable<T3>();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public virtual bool DropTable<T, T2, T3,T4>()
|
||||||
|
{
|
||||||
|
DropTable<T>();
|
||||||
|
DropTable<T2>();
|
||||||
|
DropTable<T3>();
|
||||||
|
DropTable<T4>();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
public virtual bool TruncateTable<T>()
|
public virtual bool TruncateTable<T>()
|
||||||
{
|
{
|
||||||
this.Context.InitMappingInfo<T>();
|
this.Context.InitMappingInfo<T>();
|
||||||
|
@@ -32,6 +32,10 @@ namespace SqlSugar
|
|||||||
bool CreateIndex(string tableName, string [] columnNames, bool isUnique=false);
|
bool CreateIndex(string tableName, string [] columnNames, bool isUnique=false);
|
||||||
bool CreateIndex(string tableName, string[] columnNames, string IndexName, bool isUnique = false);
|
bool CreateIndex(string tableName, string[] columnNames, string IndexName, bool isUnique = false);
|
||||||
bool DropTable(string tableName);
|
bool DropTable(string tableName);
|
||||||
|
bool DropTable<T>();
|
||||||
|
bool DropTable<T,T2>();
|
||||||
|
bool DropTable<T, T2,T3>();
|
||||||
|
bool DropTable<T, T2, T3,T4>();
|
||||||
bool TruncateTable(string tableName);
|
bool TruncateTable(string tableName);
|
||||||
bool TruncateTable<T>();
|
bool TruncateTable<T>();
|
||||||
bool TruncateTable<T,T2>();
|
bool TruncateTable<T,T2>();
|
||||||
|
Reference in New Issue
Block a user