I start learning C# couple of weeks ago and I can't figure out how to declare a public const char array.
This is what I have:
public static class MyClass
{
public const char[] MyCharArray= new char[]{'a','b','x','c'};
}
The error is pretty clear, however I have not found a way to fix this:
'MyClass.MyCharArray' must be constant
It needs to be const because I need to use it as a argument for custom data annotation validation. Ex: [MyCustumValidation(MyClass.MyCharArray)]