From 90e2976aabe5b810c6af7afd504aa1d90337a14f Mon Sep 17 00:00:00 2001 From: jojo aquino Date: Sat, 22 Mar 2025 11:03:04 +0000 Subject: [PATCH] new IsInList overload --- EnotaryoPH/EnotaryoPH.Web/Common/Extensions/StringExtensions.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EnotaryoPH/EnotaryoPH.Web/Common/Extensions/StringExtensions.cs b/EnotaryoPH/EnotaryoPH.Web/Common/Extensions/StringExtensions.cs index deacccc..6523612 100644 --- a/EnotaryoPH/EnotaryoPH.Web/Common/Extensions/StringExtensions.cs +++ b/EnotaryoPH/EnotaryoPH.Web/Common/Extensions/StringExtensions.cs @@ -12,6 +12,8 @@ public static bool IsInList(this string stringValue, IEnumerable listOfEnums) where T : struct, Enum => Enum.TryParse(stringValue, out T enumValue) && listOfEnums.Contains(enumValue); + public static bool IsInList(this string stringValue, params T[] listOfEnums) where T : struct, Enum => Enum.TryParse(stringValue, out T enumValue) && listOfEnums.Contains(enumValue); + public static string NullIfWhiteSpace(this string s) => string.IsNullOrWhiteSpace(s) ? null : s; public static Guid ToGuidFromBase64(this string s)