public Task WriteToServerAsync(string destinationTable, BulkOptions bulkOptions, CancellationToken cancellationToken, params string[] fields) { BulkCopy bulk = scopedContext.ContextProvider.GetBulkCopy(scopedContext, reader, destinationTable, scopedContext.PrepareBulkOptions(bulkOptions), fields); return(bulk.WriteToServerAsync(cancellationToken)); }
public void WriteToServer(string destinationTable, BulkOptions bulkOptions, params string[] fields) { connectionStringContext.UsingConnection(x => { reader.GetBulkWriter(x).WriteToServer(destinationTable, bulkOptions, fields); }); }
public void WriteToServer(string destinationTable, BulkOptions bulkOptions, params string[] fields) { BulkCopy bulk = scopedContext.ContextProvider.GetBulkCopy(scopedContext, reader, destinationTable, scopedContext.PrepareBulkOptions(bulkOptions), fields); bulk.WriteToServer(); }
public async Task WriteToServerAsync(string destinationTable, BulkOptions bulkOptions, CancellationToken cancellationToken, params string[] fields) { await connectionStringContext.UsingConnectionAsync(async x => { await reader.GetBulkWriter(x).WriteToServerAsync(destinationTable, bulkOptions, cancellationToken, fields).ConfigureAwait(false); }).ConfigureAwait(false); }
protected internal DbContext(ContextProvider contextProvider, QueryOptions queryOptions, BulkOptions bulkOptions, ReadOptions readOptions) { this.ContextProvider = contextProvider; this.QueryOptions = queryOptions.Clone(); this.BulkOptions = bulkOptions.Clone(); this.ReadOptions = readOptions.Clone(); }
protected BulkCopy(ScopedContext context, DbDataReader reader, string destinationTable, BulkOptions bulkOptions, params string[] fields) { this.context = context; this.bulkOptions = bulkOptions; this.destinationTable = destinationTable; this.reader = reader; this.fields = fields; }
internal BulkOptions PrepareBulkOptions(BulkOptions options) { if (options == null) { return(BulkOptions.Clone().SetDefaults()); } var opt = ContextProvider.GetTyped(options, out var needClone); if (needClone) { opt = opt.Clone(); } return(opt.SetDefaults(BulkOptions).SetDefaults()); }
protected internal TransactionContext(ContextProvider contextProvider, DbTransaction transaction, QueryOptions queryOptions, BulkOptions bulkOptions, ReadOptions readOptions) : base(contextProvider, queryOptions, bulkOptions, readOptions) { this.Transaction = transaction; }
protected internal ConnectionContext(ContextProvider contextProvider, DbConnection connection, QueryOptions queryOptions, BulkOptions bulkOptions, ReadOptions readOptions) : base(contextProvider, queryOptions, bulkOptions, readOptions) { this.Connection = connection; }
protected internal ConnectionStringContext(ContextProvider contextProvider, string connectionString, QueryOptions queryOptions, BulkOptions bulkOptions, ReadOptions readOptions) : base(contextProvider, queryOptions, bulkOptions, readOptions) { this.ConnectionString = connectionString; }
public static void WriteToServer(this IWrappedCommand cmd, DbContext context, string destinationTable, BulkOptions bulkOptions, params string[] fields) { cmd.UseReader(x => x.WriteToServer(context, destinationTable, bulkOptions, fields)); }
public static Task WriteToServerAsync(this IWrappedCommand cmd, DbContext context, string destinationTable, BulkOptions bulkOptions, params string[] fields) { return(cmd.UseReaderAsync(x => x.WriteToServerAsync(context, destinationTable, bulkOptions, fields))); }
public static Task WriteToServerAsync(this IBulkWriter writer, string destinationTable, BulkOptions bulkOptions, params string[] fields) { return(writer.WriteToServerAsync(destinationTable, bulkOptions, CancellationToken.None, fields)); }
protected internal abstract ConnectionStringContext GetConnectionStringContext(string connectionString, QueryOptions queryOptions, BulkOptions bulkOptions, ReadOptions readOptions);
public static Task WriteToServerAsync <T>(this IEnumerable <T> values, DbContext context, string destinationTable, BulkOptions bulkOptions, params string[] fields) { return(values.ToDataReader().WriteToServerAsync(context, destinationTable, bulkOptions, fields)); }
public static void WriteToServer <T>(this IEnumerable <T> values, DbContext context, string destinationTable, BulkOptions bulkOptions, params string[] fields) { values.ToDataReader().WriteToServer(context, destinationTable, bulkOptions, fields); }
protected internal ScopedContext(ContextProvider contextProvider, QueryOptions queryOptions, BulkOptions bulkOptions, ReadOptions readOptions) : base(contextProvider, queryOptions, bulkOptions, readOptions) { }
public static Task WriteToServerAsync(this DbDataReader reader, DbContext context, string destinationTable, BulkOptions bulkOptions, params string[] fields) { return(reader.GetBulkWriter(context).WriteToServerAsync(destinationTable, bulkOptions, fields)); }
protected internal abstract BulkOptions GetTyped(BulkOptions options, out bool needClone);
protected internal abstract BulkCopy GetBulkCopy(ScopedContext context, DbDataReader reader, string destinationTable, BulkOptions bulkOptions, params string[] fields);
protected internal abstract TransactionContext GetTransactionContext(DbTransaction transaction, QueryOptions queryOptions, BulkOptions bulkOptions, ReadOptions readOptions);
protected internal abstract ConnectionContext GetConnectionContext(DbConnection connection, QueryOptions queryOptions, BulkOptions bulkOptions, ReadOptions readOptions);