예제 #1
0
 public void Truncate(DbContext context, TableInfo tableInfo)
 {
     context.Database.ExecuteSqlRaw(SqlQueryBuilder.DeleteTable(tableInfo.FullTableName));
 }
예제 #2
0
 public async Task TruncateAsync(DbContext context, TableInfo tableInfo)
 {
     await context.Database.ExecuteSqlRawAsync(SqlQueryBuilder.DeleteTable(tableInfo.FullTableName));
 }
예제 #3
0
 public async Task TruncateAsync(DbContext context, TableInfo tableInfo, CancellationToken cancellationToken)
 {
     string sql = SqlQueryBuilder.DeleteTable(tableInfo.FullTableName);
     await context.Database.ExecuteSqlRawAsync(sql, cancellationToken).ConfigureAwait(false);
 }