From f0662ee1d90d849eb80d34ed76512aa4da8b1774 Mon Sep 17 00:00:00 2001 From: honzapatCZ Date: Wed, 16 Sep 2026 16:39:59 +0200 Subject: [PATCH] fixup accounting api hard decepdnecy --- Utils/AutoMapPropertyUtils.cs | 6 +++--- Utils/PostgresSqlHealthCheck.cs | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Utils/AutoMapPropertyUtils.cs b/Utils/AutoMapPropertyUtils.cs index 1a7109a..097c624 100644 --- a/Utils/AutoMapPropertyUtils.cs +++ b/Utils/AutoMapPropertyUtils.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Internal; -using NejAccountingAPI.Models; +using NejCommon.Models; namespace AutoMapProperty; @@ -8,13 +8,13 @@ public class AutoMapPropertyUtils { public static T Create(IServiceProvider provider) where T : class { - var appDb = provider.GetRequiredService(); + var appDb = provider.GetRequiredService(); return appDb.Create(); } public static T Create(IServiceProvider provider, TParent parent, string name) where T : class, new() where TParent : class { - var appDb = provider.GetRequiredService(); + var appDb = provider.GetRequiredService(); return appDb.Create(parent, name); } diff --git a/Utils/PostgresSqlHealthCheck.cs b/Utils/PostgresSqlHealthCheck.cs index fc495d7..76c6e5a 100644 --- a/Utils/PostgresSqlHealthCheck.cs +++ b/Utils/PostgresSqlHealthCheck.cs @@ -2,7 +2,7 @@ using System.Text.RegularExpressions; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Diagnostics.HealthChecks; -using NejAccountingAPI.Models; +using NejCommon.Models; namespace NejCommon.Utils; @@ -31,7 +31,7 @@ public class PostgresSqlHealthCheck : IHealthCheck // Try to get DbContext via DI using var scope = _serviceProvider.CreateScope(); var dbContext = scope.ServiceProvider - .GetRequiredService(); + .GetRequiredService(); // Execute simple query to check connectivity var canConnect = await dbContext.Database @@ -64,8 +64,7 @@ public class PostgresSqlHealthCheck : IHealthCheck } // Test real query to validate permissions - var recordCount = await dbContext.ApiKeys - .CountAsync(cancellationToken); + //var recordCount = await dbContext.; return HealthCheckResult.Healthy( "PostgreSQL connection is healthy",