Yes, this may not be necessary.
[Flags] public enum Flags { F1 = 1, F2 = 2 } public void Func(Flags f = (Flags.F1 | Flags.F2)) {
Then you can call your function with or without a parameter. If you call it without any parameter, you will get (Flags.F1 | Flags.F2) as the default value passed to parameter f
If you do not want to have a default value, but the parameter is still optional, you can do
public void Func(Flags? f = null) { if (f.HasValue) { } }
source share