Skip to content

Commit f98f80e

Browse files
committed
AsyncDataAdapter ctor
1 parent 4bdb600 commit f98f80e

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

DataCommander/.Net-5.0/DataCommander.Providers/AsyncDataAdapter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal sealed class AsyncDataAdapter : IAsyncDataAdapter
2020
private static readonly ILog Log = LogFactory.Instance.GetCurrentTypeLog();
2121

2222
private readonly IProvider _provider;
23-
private readonly IEnumerable<AsyncDataAdapterCommand> _commands;
23+
private readonly IReadOnlyCollection<AsyncDataAdapterCommand> _commands;
2424
private readonly int _maxRecords;
2525
private readonly int _rowBlockSize;
2626
private readonly IResultWriter _resultWriter;
@@ -35,7 +35,7 @@ internal sealed class AsyncDataAdapter : IAsyncDataAdapter
3535

3636
#endregion
3737

38-
public AsyncDataAdapter(IProvider provider, IEnumerable<AsyncDataAdapterCommand> commands, int maxRecords, int rowBlockSize, IResultWriter resultWriter,
38+
public AsyncDataAdapter(IProvider provider, IReadOnlyCollection<AsyncDataAdapterCommand> commands, int maxRecords, int rowBlockSize, IResultWriter resultWriter,
3939
Action<IAsyncDataAdapter, Exception> endFill, Action<IAsyncDataAdapter> writeEnd)
4040
{
4141
_provider = provider;

DataCommander/.Net-5.0/DataCommander.Providers/Query/QueryForm.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ private void ExecuteQuery()
15611561
SetStatusbarPanelText("Executing query...", _colorTheme != null ? _colorTheme.ForeColor : SystemColors.ControlText);
15621562
var statements = Provider.GetStatements(query);
15631563
Log.Write(LogLevel.Trace, "Query:\r\n{0}", query);
1564-
IEnumerable<AsyncDataAdapterCommand> commands;
1564+
IReadOnlyCollection<AsyncDataAdapterCommand> commands;
15651565

15661566
if (statements.Count == 1)
15671567
{
@@ -1588,10 +1588,13 @@ private void ExecuteQuery()
15881588
}
15891589
else
15901590
commands =
1591-
from statement in statements
1592-
select new AsyncDataAdapterCommand(null, statement.LineIndex, null,
1593-
Connection.Connection.CreateCommand(new CreateCommandRequest(statement.CommandText, null, CommandType.Text, _commandTimeout,
1594-
_transaction)), null, null, null);
1591+
(
1592+
from statement in statements
1593+
select new AsyncDataAdapterCommand(null, statement.LineIndex, null,
1594+
Connection.Connection.CreateCommand(new CreateCommandRequest(statement.CommandText, null, CommandType.Text, _commandTimeout,
1595+
_transaction)), null, null, null)
1596+
)
1597+
.ToReadOnlyCollection();
15951598

15961599
int maxRecords;
15971600
IResultWriter resultWriter = null;

0 commit comments

Comments
 (0)