feat(sql): Hinzufügen generischer Überladungen zu SQLExecutor unter Verwendung von ISQL<T> über DI

Es wurden Überladungen für ExecuteFirstAsync, ExecuteSingleAsync und ExecuteAllAsync
eingeführt, die SQL-Definitionen aus dem Dependency Injection Container mittels ISQL<T> auflösen.
Außerdem wurde ein Fehler bei der Verwendung der Direktive von .cs zu standardmäßigem Schnittstellenimport korrigiert.
This commit is contained in:
Developer 02
2025-04-29 16:39:18 +02:00
parent 3b4ad2960a
commit 5331efe3c1
3 changed files with 48 additions and 1 deletions

View File

@@ -32,4 +32,10 @@ public interface ISQLExecutor<TEntity>
/// <param name="parameters">Optional parameters for the SQL query.</param>
/// <returns>An <see cref="IEnumerable{TEntity}"/> containing all matching results.</returns>
Task<IEnumerable<TEntity>> ExecuteAllAsync(string sql, CancellationToken cancellation = default, params object[] parameters);
Task<TEntity?> ExecuteFirstAsync<TSQL>(CancellationToken cancellation = default, params object[] parameters) where TSQL : ISQL<TEntity>;
Task<TEntity?> ExecuteSingleAsync<TSQL>(CancellationToken cancellation = default, params object[] parameters) where TSQL : ISQL<TEntity>;
Task<IEnumerable<TEntity>> ExecuteAllAsync<TSQL>(CancellationToken cancellation = default, params object[] parameters) where TSQL : ISQL<TEntity>;
}