From 9bc5cef681fe3f704e4f53c3716974b85f8116e8 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sun, 19 Jan 2025 11:46:26 +0000 Subject: [PATCH] Code linting of Router.cs --- Core/DI/Router.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Core/DI/Router.cs b/Core/DI/Router.cs index 1facb2b0..0c17164e 100644 --- a/Core/DI/Router.cs +++ b/Core/DI/Router.cs @@ -1,4 +1,3 @@ -using System.Text.Json; using Core.Models.Eft.Common; using Core.Models.Eft.ItemEvent; using Core.Models.Eft.Profile; @@ -45,18 +44,18 @@ public abstract class Router public abstract class StaticRouter : Router { - private List actions; - private JsonUtil _jsonUtil; + private readonly List _actions; + private readonly JsonUtil _jsonUtil; public StaticRouter(JsonUtil jsonUtil, List routes) : base() { - actions = routes; + _actions = routes; _jsonUtil = jsonUtil; } public object HandleStatic(string url, string? body, string sessionID, string output) { - var action = actions.Single(route => route.url == url); + var action = _actions.Single(route => route.url == url); var type = action.bodyType; IRequestData? info = null; if (type != null && !string.IsNullOrEmpty(body)) @@ -66,14 +65,14 @@ public abstract class StaticRouter : Router protected override List GetHandledRoutes() { - return actions.Select((route) => new HandledRoute(route.url, false)).ToList(); + return _actions.Select((route) => new HandledRoute(route.url, false)).ToList(); } } public abstract class DynamicRouter : Router { - private List actions; - private JsonUtil _jsonUtil; + private readonly List actions; + private readonly JsonUtil _jsonUtil; public DynamicRouter(JsonUtil jsonUtil, List routes) : base() {