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:
Josh 2023-06-20 00:02:24 -05:00 committed by GitHub
commit e43397ac6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 333 additions and 430 deletions

View file

@ -8,14 +8,12 @@ using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Servers.Website.Types;
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
using LBPUnion.ProjectLighthouse.Types.Logging;
using LBPUnion.ProjectLighthouse.Types.Maintenance;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Servers.Website.Pages.Admin;
public class AdminPanelPage : BaseLayout
{
public List<ICommand> Commands = MaintenanceHelper.Commands;
public AdminPanelPage(DatabaseContext database) : base(database)
{ }
@ -40,7 +38,7 @@ public class AdminPanelPage : BaseLayout
args = command + " " + args;
string[] split = args.Split(" ");
List<LogLine> runCommand = await MaintenanceHelper.RunCommand(split);
List<LogLine> runCommand = await MaintenanceHelper.RunCommand(this.HttpContext.RequestServices, split);
return this.Redirect($"~/admin?log={CryptoHelper.ToBase64(runCommand.ToLogString())}");
}