Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Dapper
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
Dapper
Commits
6b848faa
Commit
6b848faa
authored
Nov 28, 2015
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change CommandBehavior on ExecuteReaderAsync to match sync version
parent
52b1ccb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
Tests.Async.cs
Dapper.Tests/Tests.Async.cs
+13
-0
SqlMapper.Async.cs
Dapper/SqlMapper.Async.cs
+1
-1
No files found.
Dapper.Tests/Tests.Async.cs
View file @
6b848faa
...
@@ -734,6 +734,19 @@ select @@Name
...
@@ -734,6 +734,19 @@ select @@Name
"
,
new
Product
{
Id
=
1
})).
Single
();
"
,
new
Product
{
Id
=
1
})).
Single
();
id
.
IsEqualTo
(
2
);
id
.
IsEqualTo
(
2
);
}
}
[
Fact
]
public
async
Task
Issue1281_DataReaderOutOfOrderAsync
()
{
using
(
var
reader
=
await
connection
.
ExecuteReaderAsync
(
"Select 0, 1, 2"
))
{
reader
.
Read
().
IsTrue
();
reader
.
GetInt32
(
2
).
IsEqualTo
(
2
);
reader
.
GetInt32
(
0
).
IsEqualTo
(
0
);
reader
.
GetInt32
(
1
).
IsEqualTo
(
1
);
reader
.
Read
().
IsFalse
();
}
}
}
}
}
}
#
endif
#
endif
\ No newline at end of file
Dapper/SqlMapper.Async.cs
View file @
6b848faa
...
@@ -721,7 +721,7 @@ private static async Task<IDataReader> ExecuteReaderImplAsync(IDbConnection cnn,
...
@@ -721,7 +721,7 @@ private static async Task<IDataReader> ExecuteReaderImplAsync(IDbConnection cnn,
{
{
cmd
=
(
DbCommand
)
command
.
SetupCommand
(
cnn
,
paramReader
);
cmd
=
(
DbCommand
)
command
.
SetupCommand
(
cnn
,
paramReader
);
if
(
wasClosed
)
await
((
DbConnection
)
cnn
).
OpenAsync
(
command
.
CancellationToken
).
ConfigureAwait
(
false
);
if
(
wasClosed
)
await
((
DbConnection
)
cnn
).
OpenAsync
(
command
.
CancellationToken
).
ConfigureAwait
(
false
);
var
reader
=
await
cmd
.
ExecuteReaderAsync
(
GetBehavior
(
wasClosed
,
CommandBehavior
.
SequentialAccess
),
command
.
CancellationToken
).
ConfigureAwait
(
false
);
var
reader
=
await
cmd
.
ExecuteReaderAsync
(
GetBehavior
(
wasClosed
,
CommandBehavior
.
Default
),
command
.
CancellationToken
).
ConfigureAwait
(
false
);
wasClosed
=
false
;
wasClosed
=
false
;
return
reader
;
return
reader
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment