75c381e645
Added EAV inventory types Added EAV object handling philosophy Added controllers Added EF Core migration integration
22 lines
486 B
C#
22 lines
486 B
C#
using Microsoft.Extensions.Logging;
|
|
using Serilog.Core;
|
|
using WyvernInventory.Infrastructure.Data;
|
|
|
|
namespace WyvernInventory.Infrastructure.Utils;
|
|
|
|
public static class DbUtils
|
|
{
|
|
public static bool CanConnectToDatabase(DBContext db, ILogger<Logger> logger)
|
|
{
|
|
if (db.Database.CanConnect())
|
|
{
|
|
return true;
|
|
}
|
|
|
|
logger.LogCritical("Unable to connect to DB");
|
|
|
|
Environment.Exit(1);
|
|
|
|
return false;
|
|
}
|
|
} |