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