public FbModificationCommandBatchFactory(IRelationalCommandBuilderFactory commandBuilderFactory, ISqlGenerationHelper sqlGenerationHelper, IFbUpdateSqlGenerator updateSqlGenerator, IRelationalValueBufferFactoryFactory valueBufferFactoryFactory, IDbContextOptions options)
 {
     _commandBuilderFactory     = commandBuilderFactory;
     _sqlGenerationHelper       = sqlGenerationHelper;
     _updateSqlGenerator        = updateSqlGenerator;
     _valueBufferFactoryFactory = valueBufferFactoryFactory;
     _options = options;
 }
Example #2
0
        public FbModificationCommandBatch(IRelationalCommandBuilderFactory commandBuilderFactory, ISqlGenerationHelper sqlGenerationHelper, IFbUpdateSqlGenerator updateSqlGenerator, IRelationalValueBufferFactoryFactory valueBufferFactoryFactory, int?maxBatchSize)
            : base(commandBuilderFactory, sqlGenerationHelper, updateSqlGenerator, valueBufferFactoryFactory)
        {
            if (maxBatchSize.HasValue && maxBatchSize.Value <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(maxBatchSize), RelationalStrings.InvalidMaxBatchSize);
            }

            _maxBatchSize        = Math.Min(maxBatchSize ?? int.MaxValue, MaxRowCount);
            _variablesParameters = new StringBuilder();
            _bulkInsertCommands  = new List <ModificationCommand>();
            _bulkUpdateCommands  = new List <ModificationCommand>();
            _bulkDeleteCommands  = new List <ModificationCommand>();
        }