Gallery verwendet Datenbank
- Menü: Fixed typo in Gallerie - Datenbanken-Funktionen dokumentiert
This commit is contained in:
@ -5,6 +5,9 @@ using Dapper;
|
||||
|
||||
namespace DataAccess.DbAccess;
|
||||
|
||||
/// <summary>
|
||||
/// Bietet lesenden und schreibenden Zugriff auf eine Datenbank.
|
||||
/// </summary>
|
||||
public class SqlDataAccess : ISqlDataAccess
|
||||
{
|
||||
private readonly IConfiguration _config;
|
||||
@ -14,14 +17,14 @@ public class SqlDataAccess : ISqlDataAccess
|
||||
_config = config;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<T>> LoadData<T, U>(string storedProcedure, U parameters, string connectionId = "Default")
|
||||
public async Task<IEnumerable<TResult>> LoadData<TResult, TParameter>(string storedProcedure, TParameter parameters, string connectionId = "Default")
|
||||
{
|
||||
using IDbConnection connection = new SqlConnection(_config.GetConnectionString(connectionId));
|
||||
|
||||
return await connection.QueryAsync<T>(storedProcedure, parameters, commandType: CommandType.StoredProcedure);
|
||||
return await connection.QueryAsync<TResult>(storedProcedure, parameters, commandType: CommandType.StoredProcedure);
|
||||
}
|
||||
|
||||
public async Task SaveData<T>(string storedProcedure, T parameters, string connectionId = "Default")
|
||||
public async Task SaveData<TParameter>(string storedProcedure, TParameter parameters, string connectionId = "Default")
|
||||
{
|
||||
using IDbConnection connection = new SqlConnection(_config.GetConnectionString(connectionId));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user