I am trying to find what is the most elegant way to handle the below situation:
class ObjectA
{
public enum MandatoryParameters {A, B, C}
public enum OptionalParameters {D, E, F}
}
class ObjectB
{
public enum MandatoryParameters {G, H, I}
public enum OptionalParameters {J, K}
}
class Error
{
MandatoryOrOptionalParameters param;
string errorDescription;
Error(MandatoryOrOptionalParameters p, string d)
{
param = p;
errorDescription = d;
}
}
Is there any good way to create a MandatoryOrOptionalParameters
type to avoid string
? I read the few related message here and here.