fix detection label

fix schema migrator for enums
This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-08-13 10:12:25 +03:00
parent 16e5853d67
commit 4780e8c61c
7 changed files with 45 additions and 14 deletions
@@ -0,0 +1,12 @@
namespace Azaion.Common.Extensions;
public static class EnumExtensions
{
public static T GetValueOrDefault<T>(this string value, T defaultValue) where T : struct
{
if (string.IsNullOrEmpty(value))
return defaultValue;
return Enum.TryParse(value, true, out T result) ? result : defaultValue;
}
}