From 8293a0190ae88faab9f36fe383b05b51f18896dc Mon Sep 17 00:00:00 2001 From: mctaylors Date: Mon, 4 Dec 2023 18:05:37 +0300 Subject: [PATCH] Resolve conversations Signed-off-by: mctaylors --- src/Extensions/CollectionExtensions.cs | 2 +- src/Services/Update/ScheduledEventUpdateService.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Extensions/CollectionExtensions.cs b/src/Extensions/CollectionExtensions.cs index 41b6dd3..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.Count != 0 ? 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/Services/Update/ScheduledEventUpdateService.cs b/src/Services/Update/ScheduledEventUpdateService.cs index 8e9bcbf..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.Length != 0 + return filteredArray.Length > 0 ? Result.FromSuccess(filteredArray.Single()) : new NotFoundError(); }