public Module(string a, object obj) : this(a, null, obj) { }
public Module(string b, object obj) : this(null, b, obj) { }
These constructor overloads do not work
‘already defines a member with same parameter types’
I have looked around and realise that I cannot do this in c# but can anyone suggest a way around this?
Edit: Thanks for answers.
In this case I have decided that to go with this for now:
public Module(string a, object obj) : this(a, null, obj) { }
public Module(string a, string b, object obj) : this(a, b, obj) {}
So users will have to include a if they want to use b… not brilliant but there you go
Parameter names are meaningless in the context of overloads. I can see what you are trying to do, but I’m not sure why. I would dispense with it entirely:
Then call the
Moduleconstructor, passing innullvalues as appropriate.