- 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 Ignore OnMergeUpdate Expression
Description
The IgnoreOnMergeUpdateExpression
allows you to ignore some columns when the BulkMerge
method executes the update
statement, and these columns will only be used in the insert
statement.
The following example ignores the Name
and IsActive
properties while updating the records and will be considered during insertion.
using (var context = new EntityContext()) { var list = context.Customers.ToList(); list.ForEach(x => { x.IsActive = false; x.Name += "_NotMerge"; x.Description += "_Merge"; x.IsActive = false; }); context.BulkMerge(list, options => { options.IgnoreOnMergeUpdateExpression = customer => new { customer.CustomerID, customer.IsActive, customer.Name }; }); }
Author: ZZZ Projects