Add manual Excel column mapping

This commit is contained in:
2026-05-04 16:08:56 +02:00
parent 749a3209d9
commit c862a559f6
23 changed files with 1523 additions and 182 deletions
@@ -7,16 +7,25 @@ namespace TrafagSalesExporter.Services;
public class ExportLogService : IExportLogService
{
private readonly IDbContextFactory<AppDbContext> _dbFactory;
private readonly ILogger<ExportLogService> _logger;
public ExportLogService(IDbContextFactory<AppDbContext> dbFactory)
public ExportLogService(IDbContextFactory<AppDbContext> dbFactory, ILogger<ExportLogService> logger)
{
_dbFactory = dbFactory;
_logger = logger;
}
public async Task WriteAsync(ExportLog log)
{
using var db = await _dbFactory.CreateDbContextAsync();
db.ExportLogs.Add(log);
await db.SaveChangesAsync();
try
{
using var db = await _dbFactory.CreateDbContextAsync();
db.ExportLogs.Add(log);
await db.SaveChangesAsync();
}
catch (Exception ex)
{
_logger.LogError(ex, "ExportLog konnte nicht gespeichert werden: {Land} ({TSC})", log.Land, log.TSC);
}
}
}