mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-06-10 09:04:15 -04:00
19 lines
439 B
C#
19 lines
439 B
C#
using System;
|
|
|
|
namespace API.Extensions;
|
|
|
|
public static class DayOfWeekHelper
|
|
{
|
|
private static readonly Random Rnd = new();
|
|
|
|
/// <summary>
|
|
/// Returns a random DayOfWeek value.
|
|
/// </summary>
|
|
/// <returns>A randomly selected DayOfWeek.</returns>
|
|
public static DayOfWeek Random()
|
|
{
|
|
var values = Enum.GetValues<DayOfWeek>();
|
|
return (DayOfWeek)values.GetValue(Rnd.Next(values.Length))!;
|
|
}
|
|
}
|