DbContextExtensions
Class DbContextExtensions
Extending your DbContext with the missing bulk operations for SqlServer
Inheritance
Namespace: EFBox.SqlServer
Assembly: EFBox.SqlServer.dll
Syntax
public static class DbContextExtensions
Methods
BulkDelete<T>(DbContext, IEnumerable<T>, Action<BulkOptions<T>>)
Let you delete a large number of records in your database by utilizing bulk delete sql
Declaration
public static void BulkDelete<T>(this DbContext dbContext, IEnumerable<T> entities, Action<BulkOptions<T>> options)
Parameters
Type | Name | Description |
---|---|---|
DbContext | dbContext | Extending your current DbContext |
IEnumerable<><T> | entities | Records for deletion |
Action<><BulkOptions<T>> | options | Configurable options for the bulk operation |
Type Parameters
Name | Description |
---|---|
T | EF Data type that maps with your table |
BulkDelete<T>(DbContext, IEnumerable<T>)
Let you delete a large number of records in your database by utilizing bulk delete sql
Declaration
public static void BulkDelete<T>(this DbContext dbContext, IEnumerable<T> entities)
Parameters
Type | Name | Description |
---|---|---|
DbContext | dbContext | Extending your current DbContext |
IEnumerable<><T> | entities | Records for deletion |
Type Parameters
Name | Description |
---|---|
T | EF Data type that maps with your table |
BulkInsert<T>(DbContext, IEnumerable<T>, Action<BulkOptions<T>>)
Let you insert a large number of records in your database by utilizing bulk insert sql
Declaration
public static void BulkInsert<T>(this DbContext dbContext, IEnumerable<T> entities, Action<BulkOptions<T>> options)
Parameters
Type | Name | Description |
---|---|---|
DbContext | dbContext | Extending your current DbContext |
IEnumerable<><T> | entities | Records for insertion |
Action<><BulkOptions<T>> | options | Configurable options for the bulk operation |
Type Parameters
Name | Description |
---|---|
T | EF Data type that maps with your table |
BulkInsert<T>(DbContext, IEnumerable<T>)
Let you insert a large number of records in your database by utilizing bulk insert sql
Declaration
public static void BulkInsert<T>(this DbContext dbContext, IEnumerable<T> entities)
Parameters
Type | Name | Description |
---|---|---|
DbContext | dbContext | Extending your current DbContext |
IEnumerable<><T> | entities | Records for insertion |
Type Parameters
Name | Description |
---|---|
T | EF Data type that maps with your table |
BulkMerge<T>(DbContext, IEnumerable<T>, Action<MergeBulkOptions<T>>)
Let you sync a large number of records in your database by utilizing bulk sql
Declaration
public static void BulkMerge<T>(this DbContext dbContext, IEnumerable<T> entities, Action<MergeBulkOptions<T>> options)
Parameters
Type | Name | Description |
---|---|---|
DbContext | dbContext | Extending your current DbContext |
IEnumerable<><T> | entities | Records to merge |
Action<><MergeBulkOptions<T>> | options | Configurable options for the bulk operation |
Type Parameters
Name | Description |
---|---|
T | EF Data type that maps with your table |
BulkMerge<T>(DbContext, IEnumerable<T>)
Let you sync a large number of records in your database by utilizing bulk sql
Declaration
public static void BulkMerge<T>(this DbContext dbContext, IEnumerable<T> entities)
Parameters
Type | Name | Description |
---|---|---|
DbContext | dbContext | Extending your current DbContext |
IEnumerable<><T> | entities | Records to merge |
Type Parameters
Name | Description |
---|---|
T | EF Data type that maps with your table |
BulkUpdate<T>(DbContext, IEnumerable<T>, Action<BulkOptions<T>>)
Let you update a large number of records in your database by utilizing bulk udpate sql
Declaration
public static void BulkUpdate<T>(this DbContext dbContext, IEnumerable<T> entities, Action<BulkOptions<T>> options)
Parameters
Type | Name | Description |
---|---|---|
DbContext | dbContext | Extending your current DbContext |
IEnumerable<><T> | entities | Records to update |
Action<><BulkOptions<T>> | options | Configurable options for the bulk operation |
Type Parameters
Name | Description |
---|---|
T | EF Data type that maps with your table |
BulkUpdate<T>(DbContext, IEnumerable<T>)
Let you update a large number of records in your database by utilizing bulk udpate sql
Declaration
public static void BulkUpdate<T>(this DbContext dbContext, IEnumerable<T> entities)
Parameters
Type | Name | Description |
---|---|---|
DbContext | dbContext | Extending your current DbContext |
IEnumerable<><T> | entities | Records to update |
Type Parameters
Name | Description |
---|---|
T | EF Data type that maps with your table |