Esempio n. 1
0
        internal static void CheckFieldSelection(FieldsSelector fieldSelector, int sourceNum, int destinationNum, int commonNum)
        {
            switch (fieldSelector)
            {
            case FieldsSelector.Source:
                if (sourceNum > commonNum)
                {
                    throw new InvalidOperationException("FieldsSelector has value FieldsSelector.Source, but source has fields which are not presented in destination");
                }
                break;

            case FieldsSelector.Destination:
                if (destinationNum > commonNum)
                {
                    throw new InvalidOperationException("FieldsSelector has value FieldsSelector.Destination, but destination has fields which are not presented in source");
                }
                break;

            case FieldsSelector.Common:
                break;

            case FieldsSelector.Both:
                if (sourceNum > commonNum || destinationNum > commonNum)
                {
                    throw new InvalidOperationException("FieldsSelector has value FieldsSelector.Both, but source fields do not match with destination fields");
                }
                break;

            default:
                throw new ArgumentException(string.Format("Unknown FieldsSelector. Value: {0}", fieldSelector));
            }
        }
Esempio n. 2
0
 public ExecutionOptions(int? commandTimeoutSeconds = null, FieldsSelector fieldsSelector = FieldsSelector.Destination, bool caseSensitive = false, FromTypeOption fromTypeOption = FromTypeOption.Default)
     : this(new QueryOptions(commandTimeoutSeconds), new ReadOptions(fieldsSelector, caseSensitive, fromTypeOption))
 {
 }
Esempio n. 3
0
 public ImportOptions(int? commandTimeoutSeconds = null, int? batchSize = null, int? bulkCopyTimeout = null, SqlBulkCopyOptions sqlBulkCopyOptions = SqlBulkCopyOptions.Default,
   FieldsSelector fieldsSelector = FieldsSelector.Source, bool? caseSensitive = null, bool? enableStreaming = null,
   bool createTable = false, ColumnDefinitionOptions columnDefinitionOptions = null, bool? ignoreDataReaderSchemaTable = null,
   bool? checkTableIfNotExistsBeforeCreation = null)
   : this(new QueryOptions(commandTimeoutSeconds), new BulkOptions(batchSize, bulkCopyTimeout, sqlBulkCopyOptions, fieldsSelector, caseSensitive,
       enableStreaming, createTable, columnDefinitionOptions, ignoreDataReaderSchemaTable, checkTableIfNotExistsBeforeCreation))
 {
 }
Esempio n. 4
0
 public BulkOptions(int? batchSize = null, int? bulkCopyTimeout = null, SqlBulkCopyOptions sqlBulkCopyOptions = SqlBulkCopyOptions.Default,
   FieldsSelector fieldsSelector = FieldsSelector.Source, bool? caseSensitive = null, bool? enableStreaming = null,
   bool createTable = false, ColumnDefinitionOptions columnDefinitionOptions = null, bool? ignoreDataReaderSchemaTable = null,
   bool? checkTableIfNotExistsBeforeCreation = null)
 {
     this.BatchSize = batchSize;
     this.BulkCopyTimeout = bulkCopyTimeout;
     this.SqlBulkCopyOptions = sqlBulkCopyOptions;
     this.FieldsSelector = fieldsSelector;
     this.CaseSensitive = caseSensitive;
     this.EnableStreaming = enableStreaming;
     this.CreateTable = createTable;
     this.ColumnDefinitionOptions = columnDefinitionOptions;
     this.IgnoreDataReaderSchemaTable = ignoreDataReaderSchemaTable;
     this.CheckTableIfNotExistsBeforeCreation = checkTableIfNotExistsBeforeCreation;
 }
Esempio n. 5
0
 protected void CheckFieldSelection(FieldsSelector fieldSelector, int sourceNum, int destinationNum, int commonNum)
 {
     Helpers.CheckFieldSelection(fieldSelector, sourceNum, destinationNum, commonNum);
 }