public static void BulkRead <T>(this DbContext context, IList <T> entities, Action <BulkConfig> bulkAction, Action <decimal> progress = null) where T : class { BulkConfig bulkConfig = new BulkConfig(); bulkAction?.Invoke(bulkConfig); DbContextBulkTransaction.Execute(context, entities, OperationType.Read, bulkConfig, progress); }
public static Task BulkReadAsync <T>(this DbContext context, IList <T> entities, Action <BulkConfig> bulkAction, Action <decimal> progress = null, CancellationToken cancellationToken = default) where T : class { BulkConfig bulkConfig = new BulkConfig(); bulkAction?.Invoke(bulkConfig); return(DbContextBulkTransaction.ExecuteAsync(context, entities, OperationType.Read, bulkConfig, progress, cancellationToken)); }
// Async methods public static Task BulkInsertAsync <T>(this DbContext context, IList <T> entities, BulkConfig bulkConfig = null, Action <decimal> progress = null, CancellationToken cancellationToken = default) where T : class { return(DbContextBulkTransaction.ExecuteAsync(context, entities, OperationType.Insert, bulkConfig, progress, cancellationToken)); }
public static void Truncate <T>(this DbContext context) where T : class { DbContextBulkTransaction.Execute <T>(context, new List <T>(), OperationType.Truncate, null, null); }
public static void BulkRead <T>(this DbContext context, IList <T> entities, BulkConfig bulkConfig = null, Action <decimal> progress = null) where T : class { DbContextBulkTransaction.Execute(context, entities, OperationType.Read, bulkConfig, progress); }
public static void BulkInsertOrUpdateOrDelete <T>(this DbContext context, IList <T> entities, BulkConfig bulkConfig = null, Action <decimal> progress = null) where T : class { DbContextBulkTransaction.Execute(context, entities, OperationType.InsertOrUpdateDelete, bulkConfig, progress); }
public static Task TruncateAsync <T>(this DbContext context, CancellationToken cancellationToken = default) where T : class { return(DbContextBulkTransaction.ExecuteAsync <T>(context, new List <T>(), OperationType.Truncate, null, null, cancellationToken)); }