Modernize and Dockerize server

This commit is contained in:
2026-03-19 13:35:53 +01:00
parent 76a2bf0e88
commit 766ed86999
21 changed files with 364 additions and 161 deletions
@@ -0,0 +1,21 @@
using System.Data.Common;
using CPATapi.Server.Interfaces;
using Microsoft.Data.SqlClient;
namespace CPATapi.Server.Repository;
public class Repository: IRepository
{
private readonly IConfiguration _config;
protected Repository(IConfiguration config)
{
_config = config;
}
protected async Task<DbConnection> OpenAsync(string name)
{
var db = new SqlConnection(_config.GetConnectionString(name));
await db.OpenAsync();
return db;
}
}