EntityFramework.Extended
EntityFramework.Extended copied to clipboard
add feature: INSERT INTO... SELECT ...
- Added the feature to execute
INSERT INTO... SELECT ...
. Different from another proposal, it uses more comfortable syntax (in my opinion), that isdbContext.DbSet.Insert(IQueryable)
. - Can execute bulk insert (a lot of rows) into a table by utilizing
SqlBulkCopy
class. It must be much faster than executingDbSet.AddRange
method (or repetitiveDbSet.Add
method) and then executingdbContext.SaveChanges
method. The syntax isdbContext.DbSet.Insert(IEnumerable<Entity>)
- Moved some repetitive codes in batch runner to
QueryHelper
- Added two members to
IBatchRunner
interface:
-
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 ("). -
DbNull
property returns null value for db command parameter. In SQL server, it returnsDBNull.Value
and in MySQL it returnnull
. This property is to avoid repetitive code when copying parameter fromObjectQuery
toDbCommand