The answer is probably no, but it can't hurt asking - is it possible to overload a method to accept same parameters, but return different type results? For example,
Naturally, I get an ambiguous statement error - while I know I can simply name the methods differently {i.e. ToArray, ToDataTable, ToDataReader, etc.}, I'm curious if there's a more elegant way to do it.string[] x = TestMethod("fnord");
string x = TestMethod("fnord");
private static string[] TestMethod(string statement) { return new string[1]; } private static string TestMethod(string statement) { return string.empty; }
C# newbie, learning on the go. I will probably ask a lot of followup questions about any answers already given, so fair warning and all.