Today I came across a scenario where I need to create a method that has the same name, params count and params types with an existing one, something like this:
public static Department GetDepartment(string departmentName) {
at first glance I just said why not call him by another name and do nothing, but I couldnβt! I want to keep the readability of my code I'm working on, I want it to be overloaded first,
so I said, why not add a fake parameter to get around this problem from a compiler point of view.
public static Department GetDepartment(string employeeID, object fakePassWtEver) {
What is the best practice for this case? I see that all the ways allow my code to work, but none of them satisfied me.
Rami shareef
source share