Skip to content

Conversation

atmulyana
Copy link

@atmulyana atmulyana commented Apr 14, 2016

  • Added the feature to execute INSERT INTO... SELECT .... Different from another proposal, it uses more comfortable syntax (in my opinion), that is dbContext.DbSet.Insert(IQueryable).
  • Can execute bulk insert (a lot of rows) into a table by utilizing SqlBulkCopy class. It must be much faster than executing DbSet.AddRange method (or repetitive DbSet.Add method) and then executing dbContext.SaveChanges method. The syntax is dbContext.DbSet.Insert(IEnumerable<Entity>)
  • Moved some repetitive codes in batch runner to QueryHelper
  • Added two members to IBatchRunner interface:
  1. Quote method is to quote an identifier. The implementation for SQL server, the identifier will be enclosed by square bracket ([]), in MySQL will be by backtick (`), in Oracle should be by double quote (").
  2. DbNull property returns null value for db command parameter. In SQL server, it returns DBNull.Value and in MySQL it return null. This property is to avoid repetitive code when copying parameter from ObjectQuery to DbCommand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant