From 4c50bdaff752c4341b9b58c7ece3f4f48bd9843a Mon Sep 17 00:00:00 2001 From: Macintxsh II <95250141+mctaylors@users.noreply.github.com> Date: Mon, 4 Dec 2023 18:18:56 +0300 Subject: [PATCH] Bump .NET version to 8.0 (#207) Signed-off-by: mctaylors --- .github/workflows/build-pr.yml | 2 +- Octobot.csproj | 2 +- src/Extensions/CollectionExtensions.cs | 2 +- src/Extensions/StringExtensions.cs | 2 +- src/Services/Update/ScheduledEventUpdateService.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index c08fa4d..e71a955 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -26,6 +26,6 @@ jobs: uses: muno92/resharper_inspectcode@1.11.0 with: solutionPath: ./Octobot.sln - ignoreIssueType: InvertIf, ConvertIfStatementToSwitchStatement + ignoreIssueType: InvertIf, ConvertIfStatementToSwitchStatement, ConvertToPrimaryConstructor extensions: ReSharperPlugin.CognitiveComplexity solutionWideAnalysis: true diff --git a/Octobot.csproj b/Octobot.csproj index 92f4755..41ac76b 100644 --- a/Octobot.csproj +++ b/Octobot.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 enable enable 2.0.0 diff --git a/src/Extensions/CollectionExtensions.cs b/src/Extensions/CollectionExtensions.cs index 5322d09..9c873f2 100644 --- a/src/Extensions/CollectionExtensions.cs +++ b/src/Extensions/CollectionExtensions.cs @@ -8,7 +8,7 @@ public static class CollectionExtensions this IEnumerable source, Func selector) { var list = source.ToList(); - return list.Any() ? list.Max(selector) : default; + return list.Count > 0 ? list.Max(selector) : default; } public static void AddIfFailed(this List list, Result result) diff --git a/src/Extensions/StringExtensions.cs b/src/Extensions/StringExtensions.cs index 13cd88a..cb8d606 100644 --- a/src/Extensions/StringExtensions.cs +++ b/src/Extensions/StringExtensions.cs @@ -45,7 +45,7 @@ public static class StringExtensions { s = s.SanitizeForBlockCode(); return - $"```{language}\n{s.SanitizeForBlockCode()}{(s.EndsWith("`", StringComparison.Ordinal) || string.IsNullOrWhiteSpace(s) ? " " : "")}```"; + $"```{language}\n{s.SanitizeForBlockCode()}{(s.EndsWith('`') || string.IsNullOrWhiteSpace(s) ? " " : "")}```"; } public static string Localized(this string key) diff --git a/src/Services/Update/ScheduledEventUpdateService.cs b/src/Services/Update/ScheduledEventUpdateService.cs index 8872ddc..af940c8 100644 --- a/src/Services/Update/ScheduledEventUpdateService.cs +++ b/src/Services/Update/ScheduledEventUpdateService.cs @@ -126,7 +126,7 @@ public sealed class ScheduledEventUpdateService : BackgroundService { var filtered = from.Where(schEvent => schEvent.ID == id); var filteredArray = filtered.ToArray(); - return filteredArray.Any() + return filteredArray.Length > 0 ? Result.FromSuccess(filteredArray.Single()) : new NotFoundError(); }