Exemple #1
0
 public MultipleRowsHelper(DataConnection dataConnection, BulkCopyOptions options, bool enforceKeepIdentity)
 {
     DataConnection = dataConnection;
     Options        = options;
     SqlBuilder     = dataConnection.DataProvider.CreateSqlBuilder();
     ValueConverter = dataConnection.MappingSchema.ValueToSqlConverter;
     Descriptor     = dataConnection.MappingSchema.GetEntityDescriptor(typeof(T));
     Columns        = Descriptor.Columns.Where(c =>
                                               !c.SkipOnInsert || enforceKeepIdentity && options.KeepIdentity == true && c.IsIdentity).ToArray();
     ParameterName = SqlBuilder.Convert("p", ConvertType.NameToQueryParameter).ToString();
     TableName     = BasicBulkCopy.GetTableName(SqlBuilder, Descriptor);
     BatchSize     = Math.Max(10, Options.MaxBatchSize ?? 1000);
 }
Exemple #2
0
 public MultipleRowsHelper(DataConnection dataConnection, BulkCopyOptions options)
 {
     DataConnection = dataConnection;
     Options        = options;
     SqlBuilder     = dataConnection.DataProvider.CreateSqlBuilder();
     ValueConverter = dataConnection.MappingSchema.ValueToSqlConverter;
     Descriptor     = dataConnection.MappingSchema.GetEntityDescriptor(typeof(T));
     Columns        = Descriptor.Columns
                      .Where(c => !c.SkipOnInsert || c.IsIdentity && options.KeepIdentity == true)
                      .ToArray();
     ColumnTypes   = Columns.Select(c => new SqlDataType(c.DataType, c.MemberType, c.Length, c.Precision, c.Scale)).ToArray();
     ParameterName = SqlBuilder.Convert("p", ConvertType.NameToQueryParameter).ToString();
     TableName     = BasicBulkCopy.GetTableName(SqlBuilder, options, Descriptor);
     BatchSize     = Math.Max(10, Options.MaxBatchSize ?? 1000);
 }
Exemple #3
0
 public MultipleRowsHelper(ITable <T> table, BulkCopyOptions options)
     : base((DataConnection)table.DataContext, options, typeof(T))
 {
     TableName = BasicBulkCopy.GetTableName(SqlBuilder, options, table);
 }