how can i add a function/method to a class that can be changed upon construction? - C#