Entity Framework Extensions – Temporary Table

Temporary Table Options

Customize how and when to use a temporary table instead of inline SQL.

Properties:

TemporaryTableBatchByTable

Allow you to set the maximum number of batches a temporary table can contain.

  • Default Value: 0 (unlimited)

Example

context.BulkSaveChanges(operation =>
{
bulk.TemporaryTableBatchByTable = 5;
});

TemporaryTableInsertBatchSize

Allow you to set the number of record by batch to insert in a temporary table.

  • Default Value: 10,000

Example

context.BulkSaveChanges(operation =>
{
bulk.TemporaryTableInsertBatchSize = 1000;
});

TemporaryTableMinRecord

Allow you to set the minimum number of records before a temporary table strategy is used.

  • Default Value: 10

Example

context.BulkSaveChanges(operation =>
{
bulk.TemporaryTableMinRecord = 15;
});

TemporaryTableUseTableLock

Allow you to lock the temporary table while being populated.

  • Default Value: true

Example

context.BulkSaveChanges(operation =>
{
bulk.TemporaryTableUseTableLock = true;
});