Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cc0aff8

Browse filesBrowse files
David EllingsworthDavid Ellingsworth
David Ellingsworth
authored and
David Ellingsworth
committed
GH-3530: The MicrosoftDataSqlClientDriver does not support the DbDataReader.GetChar method, wrap it with the SqlServerDbDataReader.
1 parent cd6fa30 commit cc0aff8
Copy full SHA for cc0aff8

File tree

2 files changed

+44
-1
lines changed
Filter options

2 files changed

+44
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by AsyncGenerator.
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
11+
using System;
12+
using System.Collections.Generic;
13+
using System.Data;
14+
using System.Data.Common;
15+
using NHibernate.AdoNet;
16+
using NHibernate.Dialect;
17+
using NHibernate.Engine;
18+
using NHibernate.SqlTypes;
19+
using NHibernate.Util;
20+
21+
namespace NHibernate.Driver
22+
{
23+
using System.Threading.Tasks;
24+
using System.Threading;
25+
public partial class MicrosoftDataSqlClientDriver : ReflectionBasedDriver, IEmbeddedBatcherFactoryProvider, IParameterAdjuster
26+
{
27+
28+
public override async Task<DbDataReader> ExecuteReaderAsync(DbCommand command, CancellationToken cancellationToken)
29+
{
30+
cancellationToken.ThrowIfCancellationRequested();
31+
var reader = await (command.ExecuteReaderAsync(cancellationToken)).ConfigureAwait(false);
32+
33+
return new SqlServerDbDataReader(reader);
34+
}
35+
}
36+
}

‎src/NHibernate/Driver/MicrosoftDataSqlClientDriver.cs

Copy file name to clipboardExpand all lines: src/NHibernate/Driver/MicrosoftDataSqlClientDriver.cs
+8-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace NHibernate.Driver
1313
/// <summary>
1414
/// A NHibernate Driver for using the SqlClient DataProvider
1515
/// </summary>
16-
public class MicrosoftDataSqlClientDriver : ReflectionBasedDriver, IEmbeddedBatcherFactoryProvider, IParameterAdjuster
16+
public partial class MicrosoftDataSqlClientDriver : ReflectionBasedDriver, IEmbeddedBatcherFactoryProvider, IParameterAdjuster
1717
{
1818
const byte MaxTime = 5;
1919

@@ -217,5 +217,12 @@ public override IResultSetsCommand GetResultSetsCommand(ISessionImplementor sess
217217
{
218218
return new BasicResultSetsCommand(session);
219219
}
220+
221+
public override DbDataReader ExecuteReader(DbCommand command)
222+
{
223+
var reader = command.ExecuteReader();
224+
225+
return new SqlServerDbDataReader(reader);
226+
}
220227
}
221228
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.