Is extentions only allowed on 'pure' methods?
I was playing arround with lambda functions and while googling I tried a
small example (In a static class):
public static Func<double, double, doubleHypotenus e = (x,y) =>
Math.Sqrt(x*x + y*y);
Now it would be cool if I could easily make it an extention on double, like:
public static Func<double, double, double, doubleHypotenus e = (this t,
x,y) =Math.Sqrt(x*x + y*y);
Is this even possible or am I just lost on syntax?
Regards
- Michael S
I was playing arround with lambda functions and while googling I tried a
small example (In a static class):
public static Func<double, double, doubleHypotenus e = (x,y) =>
Math.Sqrt(x*x + y*y);
Now it would be cool if I could easily make it an extention on double, like:
public static Func<double, double, double, doubleHypotenus e = (this t,
x,y) =Math.Sqrt(x*x + y*y);
Is this even possible or am I just lost on syntax?
Regards
- Michael S
Comment