I have the following class
public class MyClass
{
public int ElementId {get; set;}
public int? LowerBoundary {get; set;}
public int? UpperBoundary {get; set;}
public int SpecificMethod() {}
public void CommonMethod()
{
int expectedValue = SpecificMethod();
}
}
CommonMethod() is the same for every instance of this class, but I'd like SpecificMethod() to be different for each one. This method should always return an int, but it could take 0, 1 or 2 parameters (which are its own values for LowerBoundary and UpperBoundary properties).
Is there a way to achieve this? Since the number of parameter is variable, I understand I can't make SpecificMethod to be a Func property.