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

@ -1,10 +1,12 @@
@page "/debug/roomVisualizer"
@using LBPUnion.ProjectLighthouse.Database
@using LBPUnion.ProjectLighthouse.Extensions
@using LBPUnion.ProjectLighthouse.Helpers
@using LBPUnion.ProjectLighthouse.Types.Entities.Profile
@using LBPUnion.ProjectLighthouse.Types.Matchmaking.Rooms
@using LBPUnion.ProjectLighthouse.Types.Users
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Debug.RoomVisualizerPage
@inject DatabaseContext Database
@{
Layout = "Layouts/BaseLayout";
@ -59,7 +61,7 @@
#nullable enable
if (version == GameVersion.LittleBigPlanet1 || version == GameVersion.LittleBigPlanetPSP || version == GameVersion.Unknown) continue;
FindBestRoomResponse? response = RoomHelper.FindBestRoom(null, version, null, null, null);
FindBestRoomResponse? response = RoomHelper.FindBestRoom(Database, null, version, null, null, null);
string text = response == null ? "No room found." : "Room " + response.RoomId;
<p><b>Best room for @version.ToPrettyString()</b>: @text</p>