diff --git a/src/ReC.Domain/Constants/RestType.cs b/src/ReC.Domain/Constants/RestType.cs new file mode 100644 index 0000000..66ee1db --- /dev/null +++ b/src/ReC.Domain/Constants/RestType.cs @@ -0,0 +1,29 @@ +namespace ReC.Domain.Constants; + +public enum RestType +{ + None = 0, + Get = 1, + Post = 2, + Put = 3, + Patch = 4, + Delete = 5, + Head = 6, + Options = 7, + Connect = 8, + Trace = 9, + Invalid = -1, +} + +public static class RestTypeExtensions +{ + public static string ToHttpMethod(this RestType restType) + { + return restType.ToString().ToUpper(); + } + + public static bool IsValid(this RestType restType) + { + return restType != RestType.Invalid && restType != RestType.None; + } +} \ No newline at end of file