public void InsertBatch(IList <Employee> employees)
        {
            var options = new BulkCopyOptions()
            {
                BulkCopyType = BulkCopyType.MultipleRows
            };

            using (var db = new OrmCookbook())
                db.BulkCopy(options, employees);
        }
示例#2
0
        public void BulkInsert(IList <Employee> employees)
        {
            var options = new BulkCopyOptions()
            {
                BulkCopyType = BulkCopyType.ProviderSpecific
            };

            using (var db = new OrmCookbook())
                db.BulkCopy(options, employees);
        }
示例#3
0
        public void InsertLargeBatch(IList <Employee> employees, int batchSize)
        {
            var options = new BulkCopyOptions()
            {
                BulkCopyType = BulkCopyType.MultipleRows,
                MaxBatchSize = batchSize
            };

            using (var db = new OrmCookbook())
                db.BulkCopy(options, employees);
        }