Is there a library with an alternative implementation of InsertAllOnSubmit that uses SqlBulkCopy?

We know that Linq-To-Sql InsertAllOnSubmit sucks in terms of performance, but using SqlBulkCopy for bulk inserts requires some coding. Has anyone found any code / library that uses SqlBulkCopy in an alternative implementation of InsertAllOnSubmit as easy to use as the original?

+3
source share
2 answers

, , , : LINQ to SQL

imo

: GetDeleteBatchCommand. . :

private static DbCommand GetDeleteBatchCommand<TEntity>(this Table<TEntity> table, IQueryable<TEntity> entities) where TEntity : class
    {
        var deleteCommand = table.Context.GetCommand(entities);
        deleteCommand.CommandText = string.Format("DELETE {0}\r\n", table.GetDbName()) + GetBatchJoinQuery<TEntity>(table, entities);
        return deleteCommand;
    }
+2

Source: https://habr.com/ru/post/1719110/


All Articles