-
Notifications
You must be signed in to change notification settings - Fork 933
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dcc7c1c
commit 2f4730f
Showing
14 changed files
with
208 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by AsyncGenerator. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
|
||
using System; | ||
using System.Collections; | ||
using System.Data.Common; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace NHibernate.Driver | ||
{ | ||
using System.Threading.Tasks; | ||
using System.Threading; | ||
public partial class DirectCastDbDataReader : DbDataReader | ||
{ | ||
|
||
public override Task<bool> NextResultAsync(CancellationToken cancellationToken) | ||
{ | ||
if (cancellationToken.IsCancellationRequested) | ||
{ | ||
return Task.FromCanceled<bool>(cancellationToken); | ||
} | ||
return _reader.NextResultAsync(cancellationToken); | ||
} | ||
|
||
public override Task<bool> ReadAsync(CancellationToken cancellationToken) | ||
{ | ||
if (cancellationToken.IsCancellationRequested) | ||
{ | ||
return Task.FromCanceled<bool>(cancellationToken); | ||
} | ||
return _reader.ReadAsync(cancellationToken); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by AsyncGenerator. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Data; | ||
using System.Data.Common; | ||
using System.Linq; | ||
using NHibernate.Engine; | ||
using NHibernate.SqlCommand; | ||
using NHibernate.SqlTypes; | ||
using NHibernate.Util; | ||
using Environment = NHibernate.Cfg.Environment; | ||
|
||
namespace NHibernate.Driver | ||
{ | ||
using System.Threading.Tasks; | ||
using System.Threading; | ||
public abstract partial class DriverBase : IDriver, ISqlParameterFormatter | ||
{ | ||
|
||
#if NETFX | ||
#else | ||
|
||
#endif | ||
|
||
/// <summary> | ||
/// Provides a mechanism to override the default DbDataReader used | ||
/// by a data provider. Some providers don't provide a DataReader | ||
/// that implement all of the methods. | ||
/// </summary> | ||
/// <param name="cmd">The command to execute.</param> | ||
/// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param> | ||
/// <returns>A <see cref="DbDataReader">DbDataReader</see> object.</returns> | ||
public virtual Task<DbDataReader> ExecuteReaderAsync(DbCommand cmd, CancellationToken cancellationToken) | ||
{ | ||
if (cancellationToken.IsCancellationRequested) | ||
{ | ||
return Task.FromCanceled<DbDataReader>(cancellationToken); | ||
} | ||
return cmd.ExecuteReaderAsync(cancellationToken); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by AsyncGenerator. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Data; | ||
using System.Data.Common; | ||
using NHibernate.Engine; | ||
using NHibernate.SqlCommand; | ||
using NHibernate.SqlTypes; | ||
|
||
namespace NHibernate.Driver | ||
{ | ||
using System.Threading.Tasks; | ||
using System.Threading; | ||
public partial interface IDriver | ||
{ | ||
|
||
/// <summary> | ||
/// Provides a mechanism to override the default DbDataReader used | ||
/// by a data provider. Some providers don't provide a DataReader | ||
/// that implement all of the methods. | ||
/// </summary> | ||
/// <param name="cmd">The command to execute.</param> | ||
/// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param> | ||
/// <returns>A <see cref="DbDataReader">DbDataReader</see> object.</returns> | ||
Task<DbDataReader> ExecuteReaderAsync(DbCommand cmd, CancellationToken cancellationToken); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by AsyncGenerator. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
|
||
using System; | ||
using System.Data; | ||
using System.Data.Common; | ||
using NHibernate.Util; | ||
|
||
namespace NHibernate.Driver | ||
{ | ||
using System.Threading.Tasks; | ||
using System.Threading; | ||
public partial class Sql2008ClientDriver : SqlClientDriver | ||
{ | ||
|
||
#if NETFX | ||
#else | ||
|
||
#endif | ||
|
||
public override async Task<DbDataReader> ExecuteReaderAsync(DbCommand cmd, CancellationToken cancellationToken) | ||
{ | ||
cancellationToken.ThrowIfCancellationRequested(); | ||
return new DirectCastDbDataReader(await (cmd.ExecuteReaderAsync(cancellationToken)).ConfigureAwait(false)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters