[Solved] How do I inject a return type in a method that returns multiple types?


The answer to the question was:

return (T)(object) 999;

or

return (T)(object) "String";

I call this a “double cast”…

solved How do I inject a return type in a method that returns multiple types?