Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

root classes in linqpad

Classes defined in LinqPad are nested, inner classes of UserQuery. Is there a way to declare classes that are root classes?

like image 744
Ralf Avatar asked Apr 03 '11 01:04

Ralf


1 Answers

From version 2.4 / 4.4, you can create root classes in LINQPad by defining the NONEST symbol (in C# Program mode):

#define NONEST
void Main()
{
    typeof (Foo).FullName.Dump();   // Foo
}

class Foo
{
}

If you define a static class (which C# does not allow fo be nested), you don't need the NONEST symbol - LINQPad will extract your nested class automatically.

like image 61
Joe Albahari Avatar answered Nov 15 '22 10:11

Joe Albahari