Refactor RestType enum: remove Invalid, use byte

RestType now inherits from byte for efficiency. The Invalid value has been removed from the enum, and the IsValid extension method was updated to reflect this change by only checking for None.
This commit is contained in:
2025-12-15 14:35:26 +01:00
parent 90ee3f6a5d
commit f82f4d2c65

View File

@@ -1,6 +1,6 @@
namespace ReC.Domain.Constants;
public enum RestType
public enum RestType : byte
{
None = 0,
Get = 1,
@@ -12,7 +12,6 @@ public enum RestType
Options = 7,
Connect = 8,
Trace = 9,
Invalid = -1,
}
public static class RestTypeExtensions
@@ -24,6 +23,6 @@ public static class RestTypeExtensions
public static bool IsValid(this RestType restType)
{
return restType != RestType.Invalid && restType != RestType.None;
return restType != RestType.None;
}
}