I've used this helpful post to learn how to pass a list of Enum values as a parameter.
Now I would like to know whether I can make this parameter optional?
Example:
public enum EnumColors
{
[Flags]
Red = 1,
Green = 2,
Blue = 4,
Black = 8
}
I want to call my function that receives the Enum param like this:
DoSomethingWithColors(EnumColors.Red | EnumColors.Blue)
OR
DoSomethingWithColors()
My function should then look like what?
public void DoSomethingWithColors(EnumColors someColors = ??)
{
...
}