Trying to figure out how-2 per new "using static"
Simple example stymies me on how to get it into LinqPad 5 error free.
It does not like the usings. Complains they must precede all other elements defined in the namespace.
I get that - but it seems I used to get prompted to add the usings.
Maybe a more succinct question would be - how can I play with this new functionality?
using static System.Console;
using static System.Math;
using static System.DayOfWeek;
void Main()
{
WriteLine(Sqrt(3*3 + 4*4));
WriteLine(Friday - Monday);
}
It does not like the usings. Complains they must precede all other elements defined in the namespace.
I get that - but it seems I used to get prompted to add the usings.
Maybe a more succinct question would be - how can I play with this new functionality?
using static System.Console;
using static System.Math;
using static System.DayOfWeek;
void Main()
{
WriteLine(Sqrt(3*3 + 4*4));
WriteLine(Friday - Monday);
}
Comments
In the box provided, enter this: Note that you don't need to prefix each line with the 'using' directive. LINQPad adds this for you automatically. If you're pasting code from another application, LINQPad will automatically strip out the redundant 'using' directives.