S
Shapper
Hello,
I have the following class:
public abstract class Reply {
public ReplyStatus Status { get; set; }
} // Reply
public enum ReplyStatus {
Exception,
Success,
Failure
}
Each command on my service layer returns a Reply. For example:
public class SendMailToUserReply : Reply { }
The reply can return the following status:
1 - Exception (exception occurred)
2 - Success (everything worked fine)
3 - Failure
3.1 Because user is not approved (UserNotApproved)
3.2 Because user is not verified (UserNotVerified)
...
Each reply has different reasons for Failure.
So my idea would be to use a partial enum to merge all values:
public enum ReplyStatus {
Exception,
Success,
Failure
}
Merge with: UserNotApproved, UserNotVerified in SendMailToUserReply
But this is not possible.
So I am looking to return the information in (1, 2 and 3) using Enums and that is recognizable when getting an object of type Reply.
What solutions do I have?
Thank You,
Miguel
I have the following class:
public abstract class Reply {
public ReplyStatus Status { get; set; }
} // Reply
public enum ReplyStatus {
Exception,
Success,
Failure
}
Each command on my service layer returns a Reply. For example:
public class SendMailToUserReply : Reply { }
The reply can return the following status:
1 - Exception (exception occurred)
2 - Success (everything worked fine)
3 - Failure
3.1 Because user is not approved (UserNotApproved)
3.2 Because user is not verified (UserNotVerified)
...
Each reply has different reasons for Failure.
So my idea would be to use a partial enum to merge all values:
public enum ReplyStatus {
Exception,
Success,
Failure
}
Merge with: UserNotApproved, UserNotVerified in SendMailToUserReply
But this is not possible.
So I am looking to return the information in (1, 2 and 3) using Enums and that is recognizable when getting an object of type Reply.
What solutions do I have?
Thank You,
Miguel