{"id":127,"date":"2008-04-15T20:01:20","date_gmt":"2008-04-16T01:01:20","guid":{"rendered":"http:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/127"},"modified":"2008-04-15T22:12:29","modified_gmt":"2008-04-16T03:12:29","slug":"linqpad-more-than-just-a-linq-editor","status":"publish","type":"post","link":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/127","title":{"rendered":"LINQPad – More than just a LINQ editor"},"content":{"rendered":"

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

\"image\"<\/a> <\/p>\n

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. <\/p>\n

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).<\/p>\n

Here was the C# code I used in the screen shot above:<\/p>\n

Console.WriteLine(<\/span>"WiredPrairie"<\/span>);\n<\/span>var <\/span>website = <\/span>new <\/span>{ Href = <\/span>"www.wiredprairie.us"<\/span>, \n    Topics=<\/span>"Coding,Usability,Software,Photography,Java" <\/span>};\n\nIEnumerable<<\/span>string<\/span>> topics = <\/span>from <\/span>topic <\/span>in <\/span>website.Topics.Split(<\/span>','<\/span>) \n    <\/span>where <\/span>topic.IndexOf(<\/span>"Java"<\/span>) == -<\/span>1 <\/span>select <\/span>topic;\ntopics.Dump();\n<\/span><\/pre>\n

Results:<\/p>\n

\"image\"<\/a> <\/p>\n

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.)<\/p>\n

I’m not sure what to do with this button:<\/p>\n

\"image\"<\/a> <\/p>\n

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! <\/p>\n

I looked up one of the snippet compilers I used to install, "Snippet Compiler" (<\/em>here<\/em><\/a>). 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…<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"

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. 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 […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[4],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pd5QIe-23","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":388,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/388","url_meta":{"origin":127,"position":0},"title":"Silverlight Weather Demonstration","date":"June 26, 2008","format":false,"excerpt":"Demonstration available here. (You'll need to wait for a moment while it loads the first time). I've created a reasonably simple, yet multi-technology (and discipline) demonstration using Silverlight for the user interface and ASP.NET as the back-end. The demonstration uses: Silverlight 2.0 Data binding Delayed downloading of images \"Web services\"\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2008\/06\/image21.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1835,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1835","url_meta":{"origin":127,"position":1},"title":"How to rewrite a MongoDB C# LINQ with a Projection Requirement using a MongoCursor","date":"January 26, 2013","format":false,"excerpt":"The LINQ Provider for MongoDB does not currently take into account data projections efficiently when returning data. This could mean that you\u2019re unnecessarily returning more data from the database than is needed. So, I\u2019m going to show you the pattern I applied as a replacement for the LINQ queries when\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1449,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1449","url_meta":{"origin":127,"position":2},"title":".NET API for Nest Thermostat","date":"January 9, 2012","format":false,"excerpt":"I just finished a preliminary read-only (think version 0.1) wrapper around the Nest Thermostat API that is used by their mobile phone and web applications. As Nest doesn\u2019t have a formal API yet, the code could break at any time and may not be suitable for any use. However, it\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"SNAGHTML88bff0b3","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2012\/01\/SNAGHTML88bff0b3_thumb.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":670,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/670","url_meta":{"origin":127,"position":3},"title":"Silverlight: Dynamically creating XAML elements at runtime","date":"January 19, 2009","format":false,"excerpt":"Given the following XML file: <\/Canvas> <\/asset> <\/assets> It\u2019s easy enough to create reusable assets in Silverlight and load them on demand from XML, and refer to the\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2009\/01\/image8.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":426,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/426","url_meta":{"origin":127,"position":4},"title":"Visual WebGUI — Uh? Neat technology for someone else.","date":"July 16, 2008","format":false,"excerpt":"At the top of the page linked above, you can try the Ajax version or the Silverlight version of their web-mail demo. Try it. I won't say that I'm not impressed by what they've accomplished technically. It's impressive. They use a WinForms designer to build parts of the user interface\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2008\/07\/image-thumb2.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1833,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1833","url_meta":{"origin":127,"position":5},"title":"How to view the MongoDB Query when using the C# LINQ Provider","date":"January 26, 2013","format":false,"excerpt":"If you\u2019re using the Official MongoDB C# Driver from 10gen, you may want to occasionally verify that the generated query matches your LINQ query (or at least that it\u2019s building something efficient). Take for example this query: var query = (from r in DataLayer.Database.GetCollection().AsQueryable() where !r.Deleted select new { Id\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts\/127"}],"collection":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/comments?post=127"}],"version-history":[{"count":0,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts\/127\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}