LINQPad – More than just a LINQ editor

I stumbled across this .NET 3.5+ utility today, LINQPad. I think I’ll be putting this on every development machine I control — it’s been very handy today.

image

At first I thought it was just a live LINQ viewer/editor (which is useful on it’s own!). But, in order to support that type of functionality, it supports a wide variety of code snippets that you might want to experiment with, without the hassle of starting Visual Studio.

The syntax coloring editor (no Intellisense yet, sorry) makes editing code a decent experience. Once you’ve typed in your code snippet or LINQ statement, hit F5 to test it. The results appear in the bottom half of the application. I believe through extension methods, it adds a "Dump" method to IEnumerable objects so that they become nicely formatted in the resulting display (see the screen shot for an example).

Here was the C# code I used in the screen shot above:

Console.WriteLine("WiredPrairie");
var website = new { Href = "www.wiredprairie.us", 
    Topics="Coding,Usability,Software,Photography,Java" };

IEnumerable<string> topics = from topic in website.Topics.Split(',') 
    where topic.IndexOf("Java") == -1 select topic;
topics.Dump();

Results:

image

It’s free. Oddly, there’s no installer, or click once for the application (given it’s part of a book on C#, I would have thought a click-once installer would have made sense … but I won’t complain loudly since it’s free.)

I’m not sure what to do with this button:

image

I can’t get it to display anything … if someone figures it out, post a comment or send me a link if you don’t mind!

I looked up one of the snippet compilers I used to install, "Snippet Compiler" (here). There’s an "alpha" release for .NET 3.5. I stopped using that tool a few years ago when it started to "bloat" and do too much. It looks like a full editor now…