- Main Features
-
Bulk Options
- Bulk Options
- Audit
- Batch
-
Column
- Column Input Expression
- Column Output Expression
- Column InputOutput Expression
- Column PrimaryKey Expression
- Column Synchronize DeleteKey Subset Expression
- Ignore OnInsert Expression
- Ignore OnMergeInsert Expression
- Ignore OnMergeUpdate Expression
- Ignore OnSynchronizeInsert Expression
- Ignore OnSynchronizeUpdate Expression
- Ignore OnUpdate Expression
- Context Factory
- Execute Event
- ExplicitValueResolutionMode
- Identity
- Include Graph
- ForceValueGeneratedStrategy
- Key
- Logging
- Rows Affected
- Temporary Table
- Transaction
- Transient Error
- SQL Server
- Coalesce
- Coalesce Destination
- Delete Matched and Condition
- Delete Matched and one NOT Condition
- Delete Matched and Formula
- Matched and Condition
- Matched and one NOT Condition
- Matched and Formula
- Batch Operations
- Events
- Utilities
- C# Eval Expression
- Articles
- Troubleshooting
- Release Notes
Entity Framework Extensions BulkOperationExecuted
Description
The BulkOperationExecuted
event is executed after the action in the BulkOperations library is called.
Example
The following example updates the Description
and IsActive
properties after data is saved to the database in the BulkSaveChanges
method.
using (var context = new EntityContext()) { context.Customers.AddRange(list); context.BulkSaveChanges(options => { options.BulkOperationExecuted = bulkOperation => { list.ForEach(x => { x.Description = "After_Execution_Description"; x.IsActive = false; }); }; }); }
Try it in EF Core | Try it in EF6
The BulkOperationExecuted
is updating the Description
and IsActive
in the list
of customers but not in the database.
Author: ZZZ Projects