Skip to content

Commit 2f98467

Browse files
Renamed ExecuteQuery functions
1 parent c968d8e commit 2f98467

File tree

15 files changed

+153
-137
lines changed

15 files changed

+153
-137
lines changed

src/DotNetToolkit.Repository.AdoNet/Internal/AdoNetRepositoryContext.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ private static string FormatExecutingDebugQuery(string commandName, Dictionary<s
12261226
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
12271227
/// <param name="projector">A function to project each entity into a new form.</param>
12281228
/// <returns>A list which each entity has been projected into a new form.</returns>
1229-
public QueryResult<IEnumerable<TEntity>> ExecuteQuery<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector) where TEntity : class
1229+
public QueryResult<IEnumerable<TEntity>> ExecuteSqlQuery<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector) where TEntity : class
12301230
{
12311231
if (sql == null)
12321232
throw new ArgumentNullException(nameof(sql));
@@ -1264,7 +1264,7 @@ public QueryResult<IEnumerable<TEntity>> ExecuteQuery<TEntity>(string sql, Comma
12641264
/// <param name="cmdType">The command type.</param>
12651265
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
12661266
/// <returns>The number of rows affected.</returns>
1267-
public QueryResult<int> ExecuteQuery(string sql, CommandType cmdType, object[] parameters)
1267+
public QueryResult<int> ExecuteSqlCommand(string sql, CommandType cmdType, object[] parameters)
12681268
{
12691269
if (sql == null)
12701270
throw new ArgumentNullException(nameof(sql));
@@ -1653,7 +1653,7 @@ public QueryResult<IEnumerable<TResult>> GroupBy<TEntity, TGroupKey, TResult>(IQ
16531653
/// <param name="projector">A function to project each entity into a new form.</param>
16541654
/// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
16551655
/// <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>
1656-
public async Task<QueryResult<IEnumerable<TEntity>>> ExecuteQueryAsync<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector, CancellationToken cancellationToken = new CancellationToken()) where TEntity : class
1656+
public async Task<QueryResult<IEnumerable<TEntity>>> ExecuteSqlQueryAsync<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector, CancellationToken cancellationToken = new CancellationToken()) where TEntity : class
16571657
{
16581658
if (sql == null)
16591659
throw new ArgumentNullException(nameof(sql));
@@ -1692,7 +1692,7 @@ public QueryResult<IEnumerable<TResult>> GroupBy<TEntity, TGroupKey, TResult>(IQ
16921692
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
16931693
/// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
16941694
/// <returns>The <see cref="System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing the number of rows affected.</returns>
1695-
public async Task<QueryResult<int>> ExecuteQueryAsync(string sql, CommandType cmdType, object[] parameters, CancellationToken cancellationToken = new CancellationToken())
1695+
public async Task<QueryResult<int>> ExecuteSqlCommandAsync(string sql, CommandType cmdType, object[] parameters, CancellationToken cancellationToken = new CancellationToken())
16961696
{
16971697
if (sql == null)
16981698
throw new ArgumentNullException(nameof(sql));

src/DotNetToolkit.Repository.EntityFramework/Internal/EfRepositoryContext.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected override IQueryable<TEntity> AsQueryable<TEntity>(IQueryOptions<TEntit
6565
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
6666
/// <param name="projector">A function to project each entity into a new form.</param>
6767
/// <returns>A list which each entity has been projected into a new form.</returns>
68-
public override QueryResult<IEnumerable<TEntity>> ExecuteQuery<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector)
68+
public override QueryResult<IEnumerable<TEntity>> ExecuteSqlQuery<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector)
6969
{
7070
if (sql == null)
7171
throw new ArgumentNullException(nameof(sql));
@@ -117,7 +117,7 @@ public override QueryResult<IEnumerable<TEntity>> ExecuteQuery<TEntity>(string s
117117
/// <param name="cmdType">The command type.</param>
118118
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
119119
/// <returns>The number of rows affected.</returns>
120-
public override QueryResult<int> ExecuteQuery(string sql, CommandType cmdType, object[] parameters)
120+
public override QueryResult<int> ExecuteSqlCommand(string sql, CommandType cmdType, object[] parameters)
121121
{
122122
if (sql == null)
123123
throw new ArgumentNullException(nameof(sql));
@@ -342,7 +342,7 @@ protected override Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, T
342342
/// <param name="projector">A function to project each entity into a new form.</param>
343343
/// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
344344
/// <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>
345-
public override async Task<QueryResult<IEnumerable<TEntity>>> ExecuteQueryAsync<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector, CancellationToken cancellationToken = new CancellationToken())
345+
public override async Task<QueryResult<IEnumerable<TEntity>>> ExecuteSqlQueryAsync<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector, CancellationToken cancellationToken = new CancellationToken())
346346
{
347347
if (sql == null)
348348
throw new ArgumentNullException(nameof(sql));
@@ -395,7 +395,7 @@ protected override Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, T
395395
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
396396
/// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
397397
/// <returns>The <see cref="System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing the number of rows affected.</returns>
398-
public override async Task<QueryResult<int>> ExecuteQueryAsync(string sql, CommandType cmdType, object[] parameters, CancellationToken cancellationToken = new CancellationToken())
398+
public override async Task<QueryResult<int>> ExecuteSqlCommandAsync(string sql, CommandType cmdType, object[] parameters, CancellationToken cancellationToken = new CancellationToken())
399399
{
400400
if (sql == null)
401401
throw new ArgumentNullException(nameof(sql));

src/DotNetToolkit.Repository.EntityFrameworkCore/Internal/EfCoreRepositoryContext.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected override IQueryable<TEntity> AsQueryable<TEntity>(IQueryOptions<TEntit
6565
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
6666
/// <param name="projector">A function to project each entity into a new form.</param>
6767
/// <returns>A list which each entity has been projected into a new form.</returns>
68-
public override QueryResult<IEnumerable<TEntity>> ExecuteQuery<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector)
68+
public override QueryResult<IEnumerable<TEntity>> ExecuteSqlQuery<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector)
6969
{
7070
if (sql == null)
7171
throw new ArgumentNullException(nameof(sql));
@@ -117,7 +117,7 @@ public override QueryResult<IEnumerable<TEntity>> ExecuteQuery<TEntity>(string s
117117
/// <param name="cmdType">The command type.</param>
118118
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
119119
/// <returns>The number of rows affected.</returns>
120-
public override QueryResult<int> ExecuteQuery(string sql, CommandType cmdType, object[] parameters)
120+
public override QueryResult<int> ExecuteSqlCommand(string sql, CommandType cmdType, object[] parameters)
121121
{
122122
if (sql == null)
123123
throw new ArgumentNullException(nameof(sql));
@@ -345,7 +345,7 @@ protected override Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, T
345345
/// <param name="projector">A function to project each entity into a new form.</param>
346346
/// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
347347
/// <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>
348-
public override async Task<QueryResult<IEnumerable<TEntity>>> ExecuteQueryAsync<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector, CancellationToken cancellationToken = new CancellationToken())
348+
public override async Task<QueryResult<IEnumerable<TEntity>>> ExecuteSqlQueryAsync<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector, CancellationToken cancellationToken = new CancellationToken())
349349
{
350350
if (sql == null)
351351
throw new ArgumentNullException(nameof(sql));
@@ -398,7 +398,7 @@ protected override Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, T
398398
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
399399
/// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
400400
/// <returns>The <see cref="System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing the number of rows affected.</returns>
401-
public override async Task<QueryResult<int>> ExecuteQueryAsync(string sql, CommandType cmdType, object[] parameters, CancellationToken cancellationToken = new CancellationToken())
401+
public override async Task<QueryResult<int>> ExecuteSqlCommandAsync(string sql, CommandType cmdType, object[] parameters, CancellationToken cancellationToken = new CancellationToken())
402402
{
403403
if (sql == null)
404404
throw new ArgumentNullException(nameof(sql));

src/DotNetToolkit.Repository.InMemory/Internal/InMemoryRepositoryContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ protected override IQueryable<TEntity> AsQueryable<TEntity>(IQueryOptions<TEntit
194194
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
195195
/// <param name="projector">A function to project each entity into a new form.</param>
196196
/// <returns>A list which each entity has been projected into a new form.</returns>
197-
public override QueryResult<IEnumerable<TEntity>> ExecuteQuery<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector)
197+
public override QueryResult<IEnumerable<TEntity>> ExecuteSqlQuery<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector)
198198
{
199199
throw new NotSupportedException(Resources.QueryExecutionNotSupported);
200200
}
@@ -205,7 +205,7 @@ public override QueryResult<IEnumerable<TEntity>> ExecuteQuery<TEntity>(string s
205205
/// <param name="sql">The SQL query string.</param>
206206
/// <param name="cmdType">The command type.</param>
207207
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
208-
public override QueryResult<int> ExecuteQuery(string sql, CommandType cmdType, object[] parameters)
208+
public override QueryResult<int> ExecuteSqlCommand(string sql, CommandType cmdType, object[] parameters)
209209
{
210210
throw new NotSupportedException(Resources.QueryExecutionNotSupported);
211211
}

src/DotNetToolkit.Repository/Configuration/IRepositoryContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public interface IRepositoryContext : IDisposable
2323
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
2424
/// <param name="projector">A function to project each entity into a new form.</param>
2525
/// <returns>A list which each entity has been projected into a new form.</returns>
26-
QueryResult<IEnumerable<TEntity>> ExecuteQuery<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector) where TEntity : class;
26+
QueryResult<IEnumerable<TEntity>> ExecuteSqlQuery<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector) where TEntity : class;
2727

2828
/// <summary>
2929
/// Creates a raw SQL query that is executed directly in the database.
@@ -32,7 +32,7 @@ public interface IRepositoryContext : IDisposable
3232
/// <param name="cmdType">The command type.</param>
3333
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
3434
/// <returns>The number of rows affected.</returns>
35-
QueryResult<int> ExecuteQuery(string sql, CommandType cmdType, object[] parameters);
35+
QueryResult<int> ExecuteSqlCommand(string sql, CommandType cmdType, object[] parameters);
3636

3737
/// <summary>
3838
/// Begins the transaction.

src/DotNetToolkit.Repository/Configuration/IRepositoryContextAsync.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public interface IRepositoryContextAsync : IRepositoryContext, IDisposable
2525
/// <param name="projector">A function to project each entity into a new form.</param>
2626
/// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
2727
/// <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>
28-
Task<QueryResult<IEnumerable<TEntity>>> ExecuteQueryAsync<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector, CancellationToken cancellationToken = new CancellationToken()) where TEntity : class;
28+
Task<QueryResult<IEnumerable<TEntity>>> ExecuteSqlQueryAsync<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector, CancellationToken cancellationToken = new CancellationToken()) where TEntity : class;
2929

3030
/// <summary>
3131
/// Asynchronously creates raw SQL query that is executed directly in the database.
@@ -35,7 +35,7 @@ public interface IRepositoryContextAsync : IRepositoryContext, IDisposable
3535
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
3636
/// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
3737
/// <returns>The <see cref="System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing the number of rows affected.</returns>
38-
Task<QueryResult<int>> ExecuteQueryAsync(string sql, CommandType cmdType, object[] parameters, CancellationToken cancellationToken = new CancellationToken());
38+
Task<QueryResult<int>> ExecuteSqlCommandAsync(string sql, CommandType cmdType, object[] parameters, CancellationToken cancellationToken = new CancellationToken());
3939

4040
/// <summary>
4141
/// Asynchronously saves all changes made in this context to the database.

src/DotNetToolkit.Repository/Configuration/LinqRepositoryContextBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public abstract class LinqRepositoryContextBase : IRepositoryContext
4949
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
5050
/// <param name="projector">A function to project each entity into a new form.</param>
5151
/// <returns>A list which each entity has been projected into a new form.</returns>
52-
public abstract QueryResult<IEnumerable<TEntity>> ExecuteQuery<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector) where TEntity : class;
52+
public abstract QueryResult<IEnumerable<TEntity>> ExecuteSqlQuery<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector) where TEntity : class;
5353

5454
/// <summary>
5555
/// Creates a raw SQL query that is executed directly in the database.
@@ -58,7 +58,7 @@ public abstract class LinqRepositoryContextBase : IRepositoryContext
5858
/// <param name="cmdType">The command type.</param>
5959
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
6060
/// <returns>The number of rows affected.</returns>
61-
public abstract QueryResult<int> ExecuteQuery(string sql, CommandType cmdType, object[] parameters);
61+
public abstract QueryResult<int> ExecuteSqlCommand(string sql, CommandType cmdType, object[] parameters);
6262

6363
/// <summary>
6464
/// Begins the transaction.

src/DotNetToolkit.Repository/Configuration/LinqRepositoryContextBaseAsync.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public abstract class LinqRepositoryContextBaseAsync : LinqRepositoryContextBase
5858
/// <param name="projector">A function to project each entity into a new form.</param>
5959
/// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
6060
/// <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>
61-
public abstract Task<QueryResult<IEnumerable<TEntity>>> ExecuteQueryAsync<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector, CancellationToken cancellationToken = new CancellationToken()) where TEntity : class;
61+
public abstract Task<QueryResult<IEnumerable<TEntity>>> ExecuteSqlQueryAsync<TEntity>(string sql, CommandType cmdType, object[] parameters, Func<IDataReader, TEntity> projector, CancellationToken cancellationToken = new CancellationToken()) where TEntity : class;
6262

6363
/// <summary>
6464
/// Asynchronously creates raw SQL query that is executed directly in the database.
@@ -68,7 +68,7 @@ public abstract class LinqRepositoryContextBaseAsync : LinqRepositoryContextBase
6868
/// <param name="parameters">The parameters to apply to the SQL query string.</param>
6969
/// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
7070
/// <returns>The <see cref="System.Threading.Tasks.Task" /> that represents the asynchronous operation, containing the number of rows affected.</returns>
71-
public abstract Task<QueryResult<int>> ExecuteQueryAsync(string sql, CommandType cmdType, object[] parameters, CancellationToken cancellationToken = new CancellationToken());
71+
public abstract Task<QueryResult<int>> ExecuteSqlCommandAsync(string sql, CommandType cmdType, object[] parameters, CancellationToken cancellationToken = new CancellationToken());
7272

7373
/// <summary>
7474
/// Asynchronously saves all changes made in this context to the database.

0 commit comments

Comments
 (0)