1- namespace DotNetToolkit . Repository . AdoNet . Internal
1+ namespace DotNetToolkit . Repository . AdoNet
22{
33 using Configuration . Conventions ;
44 using Configuration . Logging ;
55 using Configuration . Logging . Internal ;
66 using Extensions ;
77 using Extensions . Internal ;
8+ using Internal ;
9+ using Queries ;
810 using Queries . Internal ;
911 using System ;
1012 using System . Collections . Generic ;
@@ -19,9 +21,9 @@ namespace DotNetToolkit.Repository.AdoNet.Internal
1921 using Utility ;
2022
2123 /// <summary>
22- /// Represents a database helper which contains various methods for retrieving nad manipulating data in a database.
24+ /// Represents a database helper which contains various methods for retrieving and manipulating data in a database.
2325 /// </summary>
24- internal class DbHelper : IDisposable
26+ public class DbHelper : IDisposable
2527 {
2628 #region Fields
2729
@@ -30,7 +32,7 @@ internal class DbHelper : IDisposable
3032 private readonly string _connectionString ;
3133 private DbConnection _connection ;
3234 private readonly bool _ownsConnection ;
33- private readonly DataAccessProviderType _providerType ;
35+ private readonly Internal . DataAccessProviderType _providerType ;
3436 private readonly IRepositoryConventions _conventions ;
3537
3638 #endregion
@@ -40,7 +42,7 @@ internal class DbHelper : IDisposable
4042 /// <summary>
4143 /// Gets the provider type.
4244 /// </summary>
43- public DataAccessProviderType ProviderType { get { return _providerType ; } }
45+ internal Internal . DataAccessProviderType ProviderType { get { return _providerType ; } }
4446
4547 /// <summary>
4648 /// Gets the provider factory.
@@ -89,10 +91,10 @@ public DbHelper(IRepositoryConventions conventions, string nameOrConnectionStrin
8991 var css = GetConnectionStringSettings ( nameOrConnectionString ) ;
9092
9193 _conventions = conventions ;
92- _factory = DbProviderFactories . GetFactory ( css . ProviderName ) ;
94+ _factory = Internal . DbProviderFactories . GetFactory ( css . ProviderName ) ;
9395 _connectionString = css . ConnectionString ;
9496 _ownsConnection = true ;
95- _providerType = DataAccessProvider . GetProviderType ( css . ProviderName ) ;
97+ _providerType = Internal . DataAccessProvider . GetProviderType ( css . ProviderName ) ;
9698 }
9799
98100 /// <summary>
@@ -108,10 +110,10 @@ public DbHelper(IRepositoryConventions conventions, string providerName, string
108110 Guard . NotEmpty ( connectionString , nameof ( connectionString ) ) ;
109111
110112 _conventions = conventions ;
111- _factory = DbProviderFactories . GetFactory ( providerName ) ;
113+ _factory = Internal . DbProviderFactories . GetFactory ( providerName ) ;
112114 _connectionString = connectionString ;
113115 _ownsConnection = true ;
114- _providerType = DataAccessProvider . GetProviderType ( providerName ) ;
116+ _providerType = Internal . DataAccessProvider . GetProviderType ( providerName ) ;
115117 }
116118
117119 /// <summary>
@@ -133,7 +135,7 @@ public DbHelper(IRepositoryConventions conventions, DbConnection existingConnect
133135
134136 var css = GetConnectionStringSettings ( existingConnection . ConnectionString ) ;
135137
136- _providerType = DataAccessProvider . GetProviderType ( css . ProviderName ) ;
138+ _providerType = Internal . DataAccessProvider . GetProviderType ( css . ProviderName ) ;
137139 }
138140
139141 #endregion
@@ -429,7 +431,7 @@ public T ExecuteObject<T>(string cmdText, Dictionary<string, object> parameters,
429431 /// <param name="parameters">The command parameters.</param>
430432 /// <param name="projector">A function to project each entity into a new form.</param>
431433 /// <returns>A list which each entity has been projected into a new form.</returns>
432- public PagedQueryResult < IEnumerable < T > > ExecuteList < T > ( string cmdText , CommandType cmdType , Dictionary < string , object > parameters , Func < DbDataReader , IRepositoryConventions , T > projector )
434+ public IPagedQueryResult < IEnumerable < T > > ExecuteList < T > ( string cmdText , CommandType cmdType , Dictionary < string , object > parameters , Func < DbDataReader , IRepositoryConventions , T > projector )
433435 {
434436 using ( var reader = ExecuteReader ( cmdText , cmdType , parameters ) )
435437 {
@@ -471,7 +473,7 @@ public PagedQueryResult<IEnumerable<T>> ExecuteList<T>(string cmdText, CommandTy
471473 /// <param name="parameters">The command parameters.</param>
472474 /// <param name="projector">A function to project each entity into a new form.</param>
473475 /// <returns>A list which each entity has been projected into a new form.</returns>
474- public PagedQueryResult < IEnumerable < T > > ExecuteList < T > ( string cmdText , Dictionary < string , object > parameters , Func < DbDataReader , IRepositoryConventions , T > projector )
476+ public IPagedQueryResult < IEnumerable < T > > ExecuteList < T > ( string cmdText , Dictionary < string , object > parameters , Func < DbDataReader , IRepositoryConventions , T > projector )
475477 {
476478 return ExecuteList < T > ( cmdText , CommandType . Text , parameters , projector ) ;
477479 }
@@ -483,7 +485,7 @@ public PagedQueryResult<IEnumerable<T>> ExecuteList<T>(string cmdText, Dictionar
483485 /// <param name="cmdText">The command text.</param>
484486 /// <param name="parameters">The command parameters.</param>
485487 /// <returns>A list which each entity has been projected into a new form.</returns>
486- public PagedQueryResult < IEnumerable < T > > ExecuteList < T > ( string cmdText , Dictionary < string , object > parameters ) where T : class
488+ public IPagedQueryResult < IEnumerable < T > > ExecuteList < T > ( string cmdText , Dictionary < string , object > parameters ) where T : class
487489 {
488490 var mapper = new Mapper < T > ( _conventions ) ;
489491
@@ -498,7 +500,7 @@ public PagedQueryResult<IEnumerable<T>> ExecuteList<T>(string cmdText, Dictionar
498500 /// <param name="cmdType">The command type.</param>
499501 /// <param name="projector">A function to project each entity into a new form.</param>
500502 /// <returns>A list which each entity has been projected into a new form.</returns>
501- public PagedQueryResult < IEnumerable < T > > ExecuteList < T > ( string cmdText , CommandType cmdType , Func < DbDataReader , IRepositoryConventions , T > projector )
503+ public IPagedQueryResult < IEnumerable < T > > ExecuteList < T > ( string cmdText , CommandType cmdType , Func < DbDataReader , IRepositoryConventions , T > projector )
502504 {
503505 return ExecuteList < T > ( cmdText , cmdType , null , projector ) ;
504506 }
@@ -778,7 +780,7 @@ public Dictionary<TDictionaryKey, TElement> ExecuteDictionary<TDictionaryKey, TE
778780 /// <param name="projector">A function to project each entity into a new form.</param>
779781 /// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
780782 /// <returns>The <see cref="System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing a list which each entity has been projected into a new form.</returns>
781- public async Task < PagedQueryResult < IEnumerable < T > > > ExecuteListAsync < T > ( string cmdText , CommandType cmdType , Dictionary < string , object > parameters , Func < DbDataReader , IRepositoryConventions , T > projector , CancellationToken cancellationToken = new CancellationToken ( ) )
783+ public async Task < IPagedQueryResult < IEnumerable < T > > > ExecuteListAsync < T > ( string cmdText , CommandType cmdType , Dictionary < string , object > parameters , Func < DbDataReader , IRepositoryConventions , T > projector , CancellationToken cancellationToken = new CancellationToken ( ) )
782784 {
783785 using ( var reader = await ExecuteReaderAsync ( cmdText , cmdType , parameters , cancellationToken ) )
784786 {
@@ -821,7 +823,7 @@ public Dictionary<TDictionaryKey, TElement> ExecuteDictionary<TDictionaryKey, TE
821823 /// <param name="projector">A function to project each entity into a new form.</param>
822824 /// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
823825 /// <returns>The <see cref="System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing a list which each entity has been projected into a new form.</returns>
824- public Task < PagedQueryResult < IEnumerable < T > > > ExecuteListAsync < T > ( string cmdText , Dictionary < string , object > parameters , Func < DbDataReader , IRepositoryConventions , T > projector , CancellationToken cancellationToken = new CancellationToken ( ) )
826+ public Task < IPagedQueryResult < IEnumerable < T > > > ExecuteListAsync < T > ( string cmdText , Dictionary < string , object > parameters , Func < DbDataReader , IRepositoryConventions , T > projector , CancellationToken cancellationToken = new CancellationToken ( ) )
825827 {
826828 return ExecuteListAsync < T > ( cmdText , CommandType . Text , parameters , projector , cancellationToken ) ;
827829 }
@@ -834,7 +836,7 @@ public Dictionary<TDictionaryKey, TElement> ExecuteDictionary<TDictionaryKey, TE
834836 /// <param name="parameters">The command parameters.</param>
835837 /// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
836838 /// <returns>The <see cref="System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing a list which each entity has been projected into a new form.</returns>
837- public Task < PagedQueryResult < IEnumerable < T > > > ExecuteListAsync < T > ( string cmdText , Dictionary < string , object > parameters , CancellationToken cancellationToken = new CancellationToken ( ) ) where T : class
839+ public Task < IPagedQueryResult < IEnumerable < T > > > ExecuteListAsync < T > ( string cmdText , Dictionary < string , object > parameters , CancellationToken cancellationToken = new CancellationToken ( ) ) where T : class
838840 {
839841 var mapper = new Mapper < T > ( _conventions ) ;
840842
@@ -868,11 +870,17 @@ public Dictionary<TDictionaryKey, TElement> ExecuteDictionary<TDictionaryKey, TE
868870 }
869871 }
870872
873+ /// <summary>
874+ /// Maps the specified string sql data type value to <see cref="System.Type" />.
875+ /// </summary>
871876 public static Type MapToType ( string sqlDataType )
872877 {
873878 return MapToType ( MapToSqlDbType ( sqlDataType ) ) ;
874879 }
875880
881+ /// <summary>
882+ /// Maps the specified type to <see cref="System.Data.SqlDbType" />.
883+ /// </summary>
876884 public static SqlDbType MapToSqlDbType ( Type type )
877885 {
878886 var typeMap = new Dictionary < Type , SqlDbType >
0 commit comments