7 lines
220 B
C#
7 lines
220 B
C#
namespace Kynareth.Extensions;
|
|
|
|
public static class EnumHelper
|
|
{
|
|
public static T GetRandomEnumValue<T>() where T : Enum
|
|
=> (T) Enum.GetValues(typeof(T)).OfType<Enum>().OrderBy(_ => Guid.NewGuid()).FirstOrDefault();
|
|
} |