I have enum A which became two enums in version 2 enum B and C. There is a function GetSpecificEnum() which returns enum A for version 1 and should return enum B and C for version 2 and above. Function itself doing some calculations and returns enum which meets my scenario.
My problem is to properly define this function which can return two versions. I can always create two functions and somehow get calculations as private refactored method but i'm trying to avoid this.
Is there a way to do it ?
public ?? GetSpecificEnum() { if(version == 1) { //do some stuff return A.SomeValue; } else { // do some stuff return KeyValuePair<B, C>(B.SomeValue, C.SomeValue); } }