How to add a reference to an assembly in LINQPad to access custom types?
Just press F4. This will pop up the Add Reference dialog.
Just press F4. This will pop up the Add Reference dialog.
Rather than using side-effects, use the overload of Select which takes an index: stuff.Select((value, index) => new { index, value.Name }); You could do it using side-effects, but not in the way you tried: int counter = 0; var query = from a in stuff select new { count = counter++, a.Name }; I would … Read more
I wrote an extension method to Object that uses the Json.Net serializer with the pretty format option. JSON is easy enough to read when formatted like that. You miss type info, but I don’t know that you need that, especially considering how easy this is. Hasn’t failed me yet. I use Json.Net and not MS’ … Read more
If you right click in the code editor in LINQPad and choose Advanced Query Properties, there are two dialogs: Additional References and Additional Namespace Imports. 1) In Additional References, choose Add then click Browse and navigate to your custom assembly. 2) Then, in Additional Namespace Imports, type the namespaces you want to import from that … Read more
I’ve added a feature to do this Util.ClearResults();
LINQPad defines two extension methods (in LINQPad.Extensions), namely Dump() and Disassemble(). Dump() writes to the output window using LINQPad’s output formatter and is overloaded to let you specify a heading: typeof (int).Assembly.Dump (); typeof (int).Assembly.Dump (“mscorlib”); You can also specify a maximum recursion depth to override the default of 5 levels: typeof (int).Assembly.Dump (1); // … Read more