There's a function I have in an API that a lot of other libraries use, but I want to adapt it for a new feature to take an added optional parameter. The method signature is:
protected Task EnvGetJsonAsync<TReceive>(string endpointName, params object[] pathArgs)
and I wanted to add "string key = null" after pathArgs, because I have 37 references to this function that are used to this format. So that I don't have to change all 37 references (Also most of the references don't need to the optional param) I just wanted to add an optional param at the end.
I tried changing "params object[]" to just "object[]" but it caused an error with all the references. So it looked like this
protected Task EnvGetJsonAsync<TReceive>(string endpointName, params object[] pathArgs, string id = null)
and then this
protected Task EnvGetJsonAsync<TReceive>(string endpointName, object[] pathArgs, string id = null)
but both caused issues. I want a way to allow the function to take on an optional param without breaking the other 37 references. Thank you!