コード例 #1
0
ファイル: Helpers.cs プロジェクト: Liklainy/FastSql
        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));
            }
        }
コード例 #2
0
ファイル: ExecutionOptions.cs プロジェクト: gerakul/FastSql
 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))
 {
 }
コード例 #3
0
ファイル: Import.cs プロジェクト: gerakul/FastSql
 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))
 {
 }
コード例 #4
0
ファイル: BulkCopy.cs プロジェクト: gerakul/FastSql
 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;
 }
コード例 #5
0
 protected void CheckFieldSelection(FieldsSelector fieldSelector, int sourceNum, int destinationNum, int commonNum)
 {
     Helpers.CheckFieldSelection(fieldSelector, sourceNum, destinationNum, commonNum);
 }