Root classes in linqpad

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

+4
source share
2 answers

In version 2.4 / 4.4, you can create root classes in LINQPad by defining the NONEST character (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 to be nested), you do not need the NONEST character - LINQPad will automatically retrieve your nested class.

+10
source

Select "C # Program" as the language in newer versions.

-1
source

Source: https://habr.com/ru/post/1346397/


All Articles