I'm currently working with a very large system and have been asked to add an additional parameter to a method that's called from over 200 different places directly.
The method signature looks something like this:
public static bool SendMessageAndLog(long id, long userId, string message, string cc="", params Attachment[] attachments)
{ ... }
I need to be able to log the id of the event this message is associated with. I'm kinda stuck between 2 solutions:
- Creating a new method that does exactly the same thing but takes the event ID as well, stripping the old method and making it call the new method
- Adding an optional parameter for the event id and going through and using named parameters for the 200 calls which seems like a massive pain
Are there any more other potential solutions to this? What would be the best practice in this case keeping in mind that I can't refactor this too much.