From d2e582988ddd8bcf2dc3b71b7470930ddb8e9468 Mon Sep 17 00:00:00 2001 From: Anders Bjerner Date: Thu, 27 Jun 2024 13:51:56 +0200 Subject: [PATCH] Misc minor cleanup --- src/Skybrud.Essentials.Umbraco/HttpContextExtensions.cs | 2 +- src/Skybrud.Essentials.Umbraco/Scheduling/TaskHelper.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Skybrud.Essentials.Umbraco/HttpContextExtensions.cs b/src/Skybrud.Essentials.Umbraco/HttpContextExtensions.cs index 4f699a5..4e81c08 100644 --- a/src/Skybrud.Essentials.Umbraco/HttpContextExtensions.cs +++ b/src/Skybrud.Essentials.Umbraco/HttpContextExtensions.cs @@ -32,7 +32,7 @@ public static bool IsBackOfficeAuthenticated(this HttpContext? context) { /// if the user is logged in to the backoffice; otherwise, . public static bool IsBackOfficeAuthenticated(this HttpContext? context, [NotNullWhen(true)] out ClaimsIdentity? identity) { - // Check whether a backoffice identity is already available at this point - eg. for a backoffice request + // Check whether a backoffice identity is already available at this point - e.g. for a backoffice request if (TryGetBackOfficeIdentity(context, out identity)) return true; // Try to authenticate the user diff --git a/src/Skybrud.Essentials.Umbraco/Scheduling/TaskHelper.cs b/src/Skybrud.Essentials.Umbraco/Scheduling/TaskHelper.cs index a096c9b..b75c14e 100644 --- a/src/Skybrud.Essentials.Umbraco/Scheduling/TaskHelper.cs +++ b/src/Skybrud.Essentials.Umbraco/Scheduling/TaskHelper.cs @@ -106,7 +106,7 @@ public bool ShouldRun(object task, DateTime now, int hour, int minute, DayOfWeek if (now < scheduled) return false; // Return "false" if the task is not supposed to run the current day - if (weekdays != null && weekdays.Length > 0 && !weekdays.Contains(now.DayOfWeek)) return false; + if (weekdays is { Length: > 0 } && !weekdays.Contains(now.DayOfWeek)) return false; // Get the last run time of the task DateTime lastRunTime = GetLastRunTime(GetTaskName(task));