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)); } }
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)) { }
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)) { }
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; }
protected void CheckFieldSelection(FieldsSelector fieldSelector, int sourceNum, int destinationNum, int commonNum) { Helpers.CheckFieldSelection(fieldSelector, sourceNum, destinationNum, commonNum); }