I have the following
public enum MessageType
{
Warning,
Info,
Error
}
public class CalculationMessage
{
public string Message { get; set; }
public MessageType Type { get; set; }
}
public class ValidationMessage
{
public string Message { get; set; }
public MessageType Type { get; set; }
public string ErrorValue { get; set; }
}
I am trying to create a base class from which both of these classes are derived, however I have a problem with the enum as a ValidationMessage can be Error / Warning / Info but a CalculationMessage can only be Warning or Info.
How is this best achieved?
Thanks in advance.