new IsInList overload

This commit is contained in:
jojo aquino 2025-03-22 11:03:04 +00:00
parent ad026acb66
commit 90e2976aab

View File

@ -12,6 +12,8 @@
public static bool IsInList<T>(this string stringValue, IEnumerable<T> listOfEnums) where T : struct, Enum => Enum.TryParse(stringValue, out T enumValue) && listOfEnums.Contains(enumValue); public static bool IsInList<T>(this string stringValue, IEnumerable<T> listOfEnums) where T : struct, Enum => Enum.TryParse(stringValue, out T enumValue) && listOfEnums.Contains(enumValue);
public static bool IsInList<T>(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 string NullIfWhiteSpace(this string s) => string.IsNullOrWhiteSpace(s) ? null : s;
public static Guid ToGuidFromBase64(this string s) public static Guid ToGuidFromBase64(this string s)