Refactor Database class (#616)

Refactor Database into DatabaseContext
Moved into separate folder so it actually has a namespace instead sitting in the root
This commit is contained in:
Josh 2023-02-15 23:54:30 -06:00 committed by GitHub
parent 2aff26f83d
commit 64b95e807d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
246 changed files with 1211 additions and 965 deletions

View file

@ -1,5 +1,6 @@
#nullable enable
using LBPUnion.ProjectLighthouse.Configuration;
using LBPUnion.ProjectLighthouse.Database;
using LBPUnion.ProjectLighthouse.Servers.API.Responses;
using LBPUnion.ProjectLighthouse.Types.Entities.Level;
using Microsoft.AspNetCore.Mvc;
@ -12,9 +13,9 @@ namespace LBPUnion.ProjectLighthouse.Servers.API.Controllers;
/// </summary>
public class SlotEndpoints : ApiEndpointController
{
private readonly Database database;
private readonly DatabaseContext database;
public SlotEndpoints(Database database)
public SlotEndpoints(DatabaseContext database)
{
this.database = database;
}

View file

@ -1,3 +1,4 @@
using LBPUnion.ProjectLighthouse.Database;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Servers.API.Responses;
using LBPUnion.ProjectLighthouse.Types.Users;
@ -11,9 +12,9 @@ namespace LBPUnion.ProjectLighthouse.Servers.API.Controllers;
public class StatisticsEndpoints : ApiEndpointController
{
private readonly Database database;
private readonly DatabaseContext database;
public StatisticsEndpoints(Database database)
public StatisticsEndpoints(DatabaseContext database)
{
this.database = database;
}

View file

@ -1,4 +1,5 @@
#nullable enable
using LBPUnion.ProjectLighthouse.Database;
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
using LBPUnion.ProjectLighthouse.Types.Entities.Token;
@ -13,9 +14,9 @@ namespace LBPUnion.ProjectLighthouse.Servers.API.Controllers;
/// </summary>
public class UserEndpoints : ApiEndpointController
{
private readonly Database database;
private readonly DatabaseContext database;
public UserEndpoints(Database database)
public UserEndpoints(DatabaseContext database)
{
this.database = database;
}

View file

@ -1,3 +1,4 @@
using LBPUnion.ProjectLighthouse.Database;
using LBPUnion.ProjectLighthouse.Middlewares;
using LBPUnion.ProjectLighthouse.Serialization;
using Microsoft.OpenApi.Models;
@ -25,7 +26,7 @@ public class ApiStartup
}
);
services.AddDbContext<Database>();
services.AddDbContext<DatabaseContext>();
services.AddSwaggerGen
(