c# - Entity Framework Bulk Merge -


I am trying to use the entity framework to perform a merge operation. I have tried to use the intuitive approach to retrieve the record and then logic in the code, but it is very slow.

I have also noticed using bulk entry library as a discussion, but it only supports bulk inserts

So far my work was done to create a stored procedure There is a table value type defined for my table, using the reflection, the input dataset is generated dynamically, and then executes the stored procedure.

What does this mean, of course, every time my table definition changes, I'll have to change the stored procedure code and table price type now.

Is there a better way to do this? If I can dynamically generate the definitions of columns from the unit framework which will be a great help in advance.

Edit: I am talking about T-SQL merge:

The best solution probably depends on exactly from "a merge operation".

What do you mean if you want to include organizations from the set (table, CSV-file or whatever), then A which is not present in the set B , you can define GetHashCode and similarity methods appropriate for your organizations

  1. >
  2. Records all the current B in memory (assuming they fit in memory), in HashSet h
  3. A , ah , which should be very fast, and then A \ H to B , possibly bulk entry library.

    The key here is to prevent database lookup for each element in A .


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -