File tree Expand file tree Collapse file tree 4 files changed +86
-0
lines changed Expand file tree Collapse file tree 4 files changed +86
-0
lines changed Original file line number Diff line number Diff line change 2
2
using System . Collections ;
3
3
using System . Data ;
4
4
using System . Data . Common ;
5
+ #if ASYNC
6
+ using System . Threading ;
7
+ using System . Threading . Tasks ;
8
+ #endif
5
9
6
10
namespace NHibernate . AdoNet
7
11
{
@@ -47,6 +51,23 @@ public override bool Read()
47
51
return rs . Read ( ) ;
48
52
}
49
53
54
+ #if ASYNC
55
+ public override Task < bool > ReadAsync ( CancellationToken cancellationToken )
56
+ {
57
+ return rs . ReadAsync ( cancellationToken ) ;
58
+ }
59
+
60
+ public override Task < bool > NextResultAsync ( CancellationToken cancellationToken )
61
+ {
62
+ return rs . NextResultAsync ( cancellationToken ) ;
63
+ }
64
+
65
+ public override Task < bool > IsDBNullAsync ( int ordinal , CancellationToken cancellationToken )
66
+ {
67
+ return rs . IsDBNullAsync ( ordinal , cancellationToken ) ;
68
+ }
69
+ #endif
70
+
50
71
public override int Depth
51
72
{
52
73
get { return rs . Depth ; }
Original file line number Diff line number Diff line change 7
7
using NHibernate . Engine ;
8
8
using NHibernate . SqlCommand ;
9
9
using NHibernate . SqlTypes ;
10
+ #if ASYNC
11
+ using System . Threading ;
12
+ using System . Threading . Tasks ;
13
+ #endif
10
14
11
15
namespace NHibernate . Driver
12
16
{
@@ -273,6 +277,23 @@ public override bool Read()
273
277
return reader . Read ( ) ;
274
278
}
275
279
280
+ #if ASYNC
281
+ public override Task < bool > ReadAsync ( CancellationToken cancellationToken )
282
+ {
283
+ return reader . ReadAsync ( cancellationToken ) ;
284
+ }
285
+
286
+ public override Task < bool > IsDBNullAsync ( int ordinal , CancellationToken cancellationToken )
287
+ {
288
+ return reader . IsDBNullAsync ( ordinal , cancellationToken ) ;
289
+ }
290
+
291
+ public override Task < bool > NextResultAsync ( CancellationToken cancellationToken )
292
+ {
293
+ return reader . NextResultAsync ( cancellationToken ) ;
294
+ }
295
+ #endif
296
+
276
297
public override int Depth
277
298
{
278
299
get { return reader . Depth ; }
Original file line number Diff line number Diff line change 4
4
using System . Data ;
5
5
using System . Data . Common ;
6
6
using NHibernate . Util ;
7
+ #if ASYNC
8
+ using System . Threading ;
9
+ using System . Threading . Tasks ;
10
+ #endif
7
11
8
12
namespace NHibernate . Driver
9
13
{
@@ -161,6 +165,23 @@ public override bool Read()
161
165
return true ;
162
166
}
163
167
168
+ #if ASYNC
169
+ public override Task < bool > ReadAsync ( CancellationToken cancellationToken )
170
+ {
171
+ return Task . FromResult ( Read ( ) ) ;
172
+ }
173
+
174
+ public override Task < bool > NextResultAsync ( CancellationToken cancellationToken )
175
+ {
176
+ return Task . FromResult ( NextResult ( ) ) ;
177
+ }
178
+
179
+ public override Task < bool > IsDBNullAsync ( int ordinal , CancellationToken cancellationToken )
180
+ {
181
+ return Task . FromResult ( IsDBNull ( ordinal ) ) ;
182
+ }
183
+ #endif
184
+
164
185
/// <summary></summary>
165
186
public override int Depth
166
187
{
Original file line number Diff line number Diff line change 2
2
using System . Collections ;
3
3
using System . Data ;
4
4
using System . Data . Common ;
5
+ #if ASYNC
6
+ using System . Threading ;
7
+ using System . Threading . Tasks ;
8
+ #endif
5
9
6
10
namespace NHibernate . Driver
7
11
{
@@ -126,6 +130,25 @@ public override bool Read()
126
130
return _isMidstream ;
127
131
}
128
132
133
+ #if ASYNC
134
+ public override async Task < bool > ReadAsync ( CancellationToken cancellationToken )
135
+ {
136
+ _isMidstream = await _reader . ReadAsync ( cancellationToken ) ;
137
+ return _isMidstream ;
138
+ }
139
+
140
+ public override Task < bool > NextResultAsync ( CancellationToken cancellationToken )
141
+ {
142
+ _isMidstream = false ;
143
+ return _reader . NextResultAsync ( cancellationToken ) ;
144
+ }
145
+
146
+ public override Task < bool > IsDBNullAsync ( int ordinal , CancellationToken cancellationToken )
147
+ {
148
+ return _reader . IsDBNullAsync ( ordinal , cancellationToken ) ;
149
+ }
150
+ #endif
151
+
129
152
/// <summary></summary>
130
153
public override int Depth
131
154
{
You can’t perform that action at this time.
0 commit comments