This is not a question of good coding practice, I'm just working on semantics. let's say I have the following constructors ...
public FooClass(string name = "theFoo") { fooName = name; } public FooClass(string name, int num = 7, bool boo = true) : this(name) { fooNum = num; fooBool = boo; }
is it possible to use named arguments ...?
FooClass foo1 = new FooClass(num:1);
// where I pass only one named argument, relying on options to take care of the rest
or call the constructor FooClass (string, int, bool) with no arguments? how in...
FooClass foo2 = new FooClass();
source share