1
0
mirror of synced 2025-02-17 19:19:18 +01:00
2024-11-16 01:48:16 +08:00

14 lines
345 B
C#

namespace Infrastructure.Utils;
public static class ValueHelpers
{
public static T Min<T>(T a, T b) where T : IComparable
{
return Comparer<T>.Default.Compare(a, b) <= 0 ? a : b;
}
public static T Max<T>(T a, T b) where T : IComparable
{
return Comparer<T>.Default.Compare(a, b) >= 0 ? a : b;
}
}