Ejemplo n.º 1
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>();
     _sqlBulkCopyOptions = SqlBulkCopyOptions.Default;
 }
Ejemplo n.º 2
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>();
     _customColumnCollationMappings = new Dictionary <string, string>();
 }
Ejemplo n.º 3
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="customColumnMappings"></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 BulkInsert(IEnumerable <T> list, string tableName, string schema, HashSet <string> columns, HashSet <string> disableIndexList, bool disableAllIndexes, Dictionary <string, string> customColumnMappings, int bulkCopyTimeout, bool bulkCopyEnableStreaming,
                   int?bulkCopyNotifyAfter, int?bulkCopyBatchSize, SqlBulkCopyOptions sqlBulkCopyOptions, BulkOperations ext)
 {
     _list                    = list;
     _tableName               = tableName;
     _schema                  = schema;
     _columns                 = columns;
     _helper                  = new BulkOperationsHelpers();
     _updateOnList            = new List <string>();
     _disableIndexList        = disableIndexList;
     _disableAllIndexes       = disableAllIndexes;
     _customColumnMappings    = customColumnMappings;
     _bulkCopyTimeout         = bulkCopyTimeout;
     _bulkCopyEnableStreaming = bulkCopyEnableStreaming;
     _bulkCopyNotifyAfter     = bulkCopyNotifyAfter;
     _bulkCopyBatchSize       = bulkCopyBatchSize;
     _sqlBulkCopyOptions      = sqlBulkCopyOptions;
     ext.SetBulkExt(this);
 }
Ejemplo n.º 4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sourceAlias"></param>
 /// <param name="targetAlias"></param>
 /// <param name="ext"></param>
 public Setup(string sourceAlias, string targetAlias, BulkOperations ext)
 {
     _sourceAlias = sourceAlias;
     _targetAlias = targetAlias;
     _ext         = ext;
 }
Ejemplo n.º 5
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>
 /// <param name="customColumnCollationMappings"></param>
 public BulkMerge(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, Dictionary <string, string> customColumnCollationMappings)
 {
     _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>();
     _disableAllIndexes             = disableAllIndexes;
     _sqlBulkCopyOptions            = sqlBulkCopyOptions;
     _customColumnCollationMappings = customColumnCollationMappings;
     ext.SetBulkExt(this);
 }
Ejemplo n.º 6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="list"></param>
 /// <param name="sourceAlias"></param>
 /// <param name="targetAlias"></param>
 /// <param name="ext"></param>
 public CollectionSelect(IEnumerable <T> list, string sourceAlias, string targetAlias, BulkOperations ext)
 {
     _list        = list;
     _sourceAlias = sourceAlias;
     _targetAlias = targetAlias;
     _ext         = ext;
 }