Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zzzprojects/8b009471c625e5bd792d8f92c9591a33 to your computer and use it in GitHub Desktop.
Save zzzprojects/8b009471c625e5bd792d8f92c9591a33 to your computer and use it in GitHub Desktop.
// DON'T add the key if auto-generated
ctx.BulkInsert(customers, operation => operation.ColumnInputExpression =
customer => new {customer.Name, customer.Email});
// ALWAYS add the key
ctx.BulkUpdate(customers, operation => operation.ColumnInputExpression =
customer => new { customer.ID, customer.Name, customer.Email });
// ALWAYS add the key
ctx.BulkMerge(customers, operation => operation.ColumnInputExpression =
customer => new {customer.ID, customer.Name, customer.Email});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment