<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Dev Tools</title>
        <link>http://blogs.imeta.co.uk/phendry/category/66.aspx</link>
        <description>Dev Tools</description>
        <language>en-GB</language>
        <copyright>Phil Hendry</copyright>
        <generator>Subtext Version 2.1.1.1</generator>
        <item>
            <title>Using LinqPad for running code snippets</title>
            <link>http://blogs.imeta.co.uk/phendry/archive/2009/04/28/690.aspx</link>
            <description>&lt;p&gt;I’ve been meaning to blog about this for ages. I’ve been using an utterly fantastic tool called &lt;a href="http://www.linqpad.net/"&gt;LinqPad&lt;/a&gt; for a while now and find it invaluable. I initially downloaded the free version to run and learn Linq, however I’ve started to use it a lot more for running normal C# code. &lt;/p&gt;  &lt;p&gt;The benefit of LinqPad over Visual Studio is I don’t need to create a project or save anything to the disk (although this feature does seem to be coming in Visual Studio 2010.) Instead, I can just type an arbitrary C# statement, hit F5 and see the results. That may not sound so great but the other feature I find invaluable is the way it displays results. Here are a couple of examples:&lt;/p&gt;  &lt;p&gt;In this example I’m using the extension method Dump() which LinqPad has made available to nicely display the contents of an array. Notice the title that can be supplied and also the complete lack of a Main():&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/phendry/WindowsLiveWriter/UsingLinqPadforrunningcodesnippets_12169/image_2.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/phendry/WindowsLiveWriter/UsingLinqPadforrunningcodesnippets_12169/image_thumb.png" width="644" height="404" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Not that impressed? Ok how about an example using List&amp;lt;&amp;gt; containing an anonymous type:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/phendry/WindowsLiveWriter/UsingLinqPadforrunningcodesnippets_12169/image_4.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/phendry/WindowsLiveWriter/UsingLinqPadforrunningcodesnippets_12169/image_thumb_1.png" width="644" height="404" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And here’s another example where I’m using the ‘C# Program’ option rather then ‘C# Statement(s)’ – selected from the language drop down in the toolbar. This provides me with a Main() function by default. However, there’s a slighty nasty hack to allow me to add my own classes – I have to close the Program class generate behind-the-scenes by LinqPad and remember not to close the last class I define. I can live with that. This screenshot is also showing the standard intellisense features that you all know and love although you do have to fork out cash for this (currently $19) :&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/phendry/WindowsLiveWriter/UsingLinqPadforrunningcodesnippets_12169/image_6.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/phendry/WindowsLiveWriter/UsingLinqPadforrunningcodesnippets_12169/image_thumb_2.png" width="641" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;What I haven’t described are all the cool features related to Linq which includes being able to click a button and see the SQL that Linq to SQL has generated and executed against the database. And if you want to keep a library of snippets then you can save your ‘queries’ in a file where they’ll be displayed in the interface (bottom left) and can be managed in a standard folder hierarchy.&lt;/p&gt;  &lt;p&gt;I love this tool… kudos to Joseph Albahari – he’s done a fantastic job.&lt;/p&gt;&lt;img src="http://blogs.imeta.co.uk/phendry/aggbug/690.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Phil Hendry</dc:creator>
            <guid>http://blogs.imeta.co.uk/phendry/archive/2009/04/28/690.aspx</guid>
            <pubDate>Tue, 28 Apr 2009 19:42:54 GMT</pubDate>
            <wfw:comment>http://blogs.imeta.co.uk/phendry/comments/690.aspx</wfw:comment>
            <comments>http://blogs.imeta.co.uk/phendry/archive/2009/04/28/690.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.imeta.co.uk/phendry/comments/commentRss/690.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.imeta.co.uk/phendry/services/trackbacks/690.aspx</trackback:ping>
        </item>
    </channel>
</rss>