Example #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="list"></param>
 /// <param name="tableName"></param>
 /// <param name="schema"></param>
 /// <param name="columns"></param>
 /// <param name="disableIndexList"></param>
 /// <param name="disableAllIndexes"></param>
 /// <param name="sourceAlias"></param>
 /// <param name="targetAlias"></param>
 /// <param name="customColumnMappings"></param>
 /// <param name="sqlTimeout"></param>
 /// <param name="bulkCopyTimeout"></param>
 /// <param name="bulkCopyEnableStreaming"></param>
 /// <param name="bulkCopyNotifyAfter"></param>
 /// <param name="bulkCopyBatchSize"></param>
 /// <param name="sqlBulkCopyOptions"></param>
 /// <param name="ext"></param>
 public BulkInsertOrUpdate(IEnumerable <T> list, string tableName, string schema, HashSet <string> columns, HashSet <string> disableIndexList, bool disableAllIndexes, string sourceAlias, string targetAlias,
                           Dictionary <string, string> customColumnMappings, int sqlTimeout, int bulkCopyTimeout, bool bulkCopyEnableStreaming,
                           int?bulkCopyNotifyAfter, int?bulkCopyBatchSize, SqlBulkCopyOptions sqlBulkCopyOptions, BulkOperations ext)
 {
     _list                     = list;
     _tableName                = tableName;
     _schema                   = schema;
     _columns                  = columns;
     _sourceAlias              = sourceAlias;
     _targetAlias              = targetAlias;
     _customColumnMappings     = customColumnMappings;
     _sqlTimeout               = sqlTimeout;
     _bulkCopyTimeout          = bulkCopyTimeout;
     _bulkCopyEnableStreaming  = bulkCopyEnableStreaming;
     _bulkCopyNotifyAfter      = bulkCopyNotifyAfter;
     _bulkCopyBatchSize        = bulkCopyBatchSize;
     _outputIdentity           = false;
     _deleteWhenNotMatchedFlag = false;
     _helper                   = new BulkOperationsHelpers();
     _outputIdentityDic        = new Dictionary <int, T>();
     _disableIndexList         = disableIndexList;
     _matchTargetOn            = new List <string>();
     _ext = ext;
     _disableAllIndexes  = disableAllIndexes;
     _sqlBulkCopyOptions = sqlBulkCopyOptions;
     _ext.SetBulkExt(this);
 }
Example #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="list"></param>
 /// <param name="tableName"></param>
 /// <param name="sourceAlias"></param>
 /// <param name="targetAlias"></param>
 /// <param name="ext"></param>
 public Table(IEnumerable <T> list, string tableName, string sourceAlias, string targetAlias, BulkOperations ext)
 {
     _bulkCopyBatchSize       = null;
     _bulkCopyNotifyAfter     = null;
     _bulkCopyEnableStreaming = false;
     _helper              = new BulkOperationsHelpers();
     _tableName           = tableName;
     _sourceAlias         = sourceAlias;
     _targetAlias         = targetAlias;
     _sqlTimeout          = 600;
     _bulkCopyTimeout     = 600;
     _ext                 = ext;
     _list                = list;
     _schema              = Constants.DefaultSchemaName;
     Columns              = new HashSet <string>();
     UpdateOnList         = new List <string>();
     DeleteOnList         = new List <string>();
     CustomColumnMappings = new Dictionary <string, string>();
     _sqlBulkCopyOptions  = SqlBulkCopyOptions.Default;
 }
Example #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="list"></param>
 /// <param name="tableName"></param>
 /// <param name="columns"></param>
 /// <param name="schema"></param>
 /// <param name="sourceAlias"></param>
 /// <param name="targetAlias"></param>
 /// <param name="sqlTimeout"></param>
 /// <param name="bulkCopyTimeout"></param>
 /// <param name="bulkCopyEnableStreaming"></param>
 /// <param name="bulkCopyNotifyAfter"></param>
 /// <param name="bulkCopyBatchSize"></param>
 /// <param name="sqlBulkCopyOptions"></param>
 /// <param name="ext"></param>
 public AllColumnSelect(IEnumerable <T> list, string tableName, HashSet <string> columns, string schema, string sourceAlias, string targetAlias,
                        int sqlTimeout, int bulkCopyTimeout, bool bulkCopyEnableStreaming, int?bulkCopyNotifyAfter, int?bulkCopyBatchSize, SqlBulkCopyOptions sqlBulkCopyOptions,
                        BulkOperations ext)
 {
     _helper            = new BulkOperationsHelpers();
     _disableAllIndexes = false;
     _disableIndexList  = new HashSet <string>();
     _list                    = list;
     _columns                 = columns;
     _tableName               = tableName;
     _schema                  = schema;
     _sourceAlias             = sourceAlias;
     _targetAlias             = targetAlias;
     _sqlTimeout              = sqlTimeout;
     _bulkCopyTimeout         = bulkCopyTimeout;
     _bulkCopyEnableStreaming = bulkCopyEnableStreaming;
     _bulkCopyNotifyAfter     = bulkCopyNotifyAfter;
     _bulkCopyBatchSize       = bulkCopyBatchSize;
     _sqlBulkCopyOptions      = sqlBulkCopyOptions;
     _ext = ext;
     CustomColumnMappings = new Dictionary <string, string>();
 }