Created API Controllers (#1)
Removed strongly typed inventory objects Added EAV inventory types Added EAV object handling philosophy Added controllers Added EF Core migration integration Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user