Last active
February 25, 2017 09:54
-
-
Save JonathanMagnan/d6205dfdec7d446ea44219dcd148306f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Single Key | |
ctx.BulkUpdate(customers, operation => operation.ColumnPrimaryKeyExpression = | |
customer => customer.Code); | |
// Surrogate Key (with anonymous type) | |
ctx.BulkUpdate(customers, operation => operation.ColumnPrimaryKeyExpression = | |
customer => new { customer.Code1, customer.Code2, customer.Code3 }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctx.BulkUpdate(customers, operation => | |
{ | |
operation.AllowDuplicateKeys = true; | |
operation.ColumnPrimaryKeyExpression = customer => customer.Code; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment