4

I know I can add assemblies to LinqPad and I know I can paste in classes in queris, but is it possible to add CSharp class files(cs) and reference these in a query window?

I tried to a few classes but could not access them even if I included the namespace (in f4)

Thomas Adrian
  • 3,543
  • 6
  • 32
  • 62

1 Answers1

6

You can include .cs files with the #load directive (LINQPad 6 and later):

#load "c:\source\MyLib\Utils\LinqExtensions.cs"

Relative paths and wildcards are also supported:

#load "..\..\source\myutil\*.cs"
#load "..\..\source\shared\*.cs /s"
Joe Albahari
  • 30,118
  • 7
  • 80
  • 91