A simple question, I do not think it is possible, but were surprised before.
I have a library with all kinds of mathematical functions, let's look at a very simple example of flooring:
class MathLib { public static double floorcap(double floor, double value, double cap) { return Math.Min(Math.Max(floor, value), cap); } }
In another method in another class, I would just type
var mat_adjusted = floorcap(1, maturity, 5);
But this does not work, because it is not declared in this class, it is in the library. It makes me type
var mat_adjusted = MathLib.floorcap(1, maturity, 5);
which adds noise to the code. I could cut it to
using m = MyMathLibrary.MathLib; .. yadayada var mat_adjusted = m.floorcap(1, maturity, 5);
but still, I would rather not type the class name all the time. Is it possible? I write code in F # too, and you seem to be used to the fact that you do not need to specify a type / module, etc. Over time. When I have to write C #, this thing annoys me (a little), because it distracts from the actual "meat stuff".
There are many functions here when you need to call several functions nested, etc. all these points and class names add up. I like my code as clean as possible.
Thanks in advance,
Geert Yang