mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-08 14:21:27 +00:00
Implement property dependency injection for the website (#806)
* Remove most non DI usages of DbContext * Optimize website queries and refactor startup to use top level statements * Remove unused functions in UserEntity and SlotEntity * Optimize LBP1 LevelTags
This commit is contained in:
parent
727dd4e903
commit
e43397ac6a
47 changed files with 333 additions and 430 deletions
|
@ -8,9 +8,12 @@ namespace LBPUnion.ProjectLighthouse.Tests.Helpers;
|
|||
|
||||
public static class IntegrationHelper
|
||||
{
|
||||
private static readonly Lazy<bool> dbConnected = new(IsDbConnected);
|
||||
private static readonly Lazy<bool> dbConnected = new(() =>
|
||||
{
|
||||
using DatabaseContext database = DatabaseContext.CreateNewInstance();
|
||||
return database.Database.CanConnect();
|
||||
});
|
||||
|
||||
private static bool IsDbConnected() => ServerStatics.DbConnected;
|
||||
|
||||
/// <summary>
|
||||
/// Resets the database to a clean state and returns a new DatabaseContext.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue