Rename Status enum to RecStatus across the codebase
Refactored all usages of the Status enum to RecStatus to improve clarity and prevent naming conflicts with other status enums (e.g., HTTP status codes). Updated command handlers, behaviors, data models, and extension methods to use RecStatus, and adjusted related serialization logic accordingly. This makes the domain-specific status handling more explicit and maintainable.
This commit is contained in:
@@ -11,7 +11,7 @@ namespace ReC.Domain.Constants;
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <seealso cref="StatusExtensions"/>
|
||||
public enum Status : short
|
||||
public enum RecStatus : short
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates that a SQL query executed successfully (value 0).
|
||||
@@ -4,7 +4,7 @@ namespace ReC.Domain.Constants;
|
||||
|
||||
public static class StatusExtensions
|
||||
{
|
||||
public static HttpStatusCode? ToHttpStatusCode(this Status status)
|
||||
public static HttpStatusCode? ToHttpStatusCode(this RecStatus status)
|
||||
{
|
||||
int code = (int)status;
|
||||
|
||||
@@ -22,13 +22,13 @@ public static class StatusExtensions
|
||||
return value >= 200 && value <= 299;
|
||||
}
|
||||
|
||||
public static bool IsSuccess(this Status status)
|
||||
public static bool IsSuccess(this RecStatus status)
|
||||
=> status switch
|
||||
{
|
||||
Status.QuerySuccess => true,
|
||||
Status.QueryFailed => false,
|
||||
RecStatus.QuerySuccess => true,
|
||||
RecStatus.QueryFailed => false,
|
||||
_ => status.ToHttpStatusCode() is HttpStatusCode httpStatus && httpStatus.IsSuccess()
|
||||
};
|
||||
|
||||
public static Status ToStatus(this HttpStatusCode code) => (Status)(short)code;
|
||||
public static RecStatus ToStatus(this HttpStatusCode code) => (RecStatus)(short)code;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ public class ResultView
|
||||
public string? ProfileName { get; set; }
|
||||
|
||||
[Column("STATUS_ID")]
|
||||
public Status Status { get; set; }
|
||||
public RecStatus Status { get; set; }
|
||||
|
||||
[Column("STATUS")]
|
||||
public string? StatusName { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user