-
Notifications
You must be signed in to change notification settings - Fork 19
Truncate Tables
Pawel Gerr edited this page Nov 11, 2025
·
1 revision
Adds support for TRUNCATE TABLE.
Add support for truncating tables.
If you are using Lazy Loading then disable the registration of temp tables for primites types
sqlOptions.AddBulkOperationSupport(configureTempTablesForPrimitiveTypes: false).
var services = new ServiceCollection()
.AddDbContext<DemoDbContext>(builder => builder
// SQL Server
.UseSqlServer("conn-string", sqlOptions =>
{
sqlOptions.AddBulkOperationSupport();
})
// SQLite
//.UseSqlite("conn-string", sqlOptions =>
// {
// sqlOptions.AddBulkOperationSupport();
// })await ctx.TruncateTableAsync<Customer>();- Collection Parameters (temp-tables light) (SQL Server)
- Window Functions Support (RowNumber, Sum, Average, Min, Max)
- Nested (virtual) Transactions
- Table Hints (SQL Server)
- Queries accross multiple databases (SQL Server)
- Changing default schema at runtime
- If-Exists / If-Not-Exists checks in migrations (SQL Server)
- Migrations: include-columns (SQL Server)
- Migrations: identity column (SQL Server)
- Migrations: (non-)clustered PK (SQL Server)