<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Dr. Morbius, Robby and Monsters from the Id</title><subtitle type="html">A blog focused mainly on development on the Microsoft platform but with occasional thought nuggets about the IT industry, everything else Microsoft, and the future potential of the human race as it relates to technology.</subtitle><id>http://blogs.msdn.com/mpapas/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mpapas/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/mpapas/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2009-05-15T13:06:26Z</updated><entry><title>First Impressions with the New SQL Azure</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mpapas/archive/2009/08/17/first-impressions-with-the-new-sql-azure.aspx" /><id>http://blogs.msdn.com/mpapas/archive/2009/08/17/first-impressions-with-the-new-sql-azure.aspx</id><published>2009-08-17T22:04:00Z</published><updated>2009-08-17T22:04:00Z</updated><content type="html">&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;I recently had the opportunity to get access to an internal CTP of the new SQL Azure technology which, at the time of this writing, should now be available as a public CTP.&amp;nbsp; Here is a &lt;A href="http://blogs.msdn.com/ssds/archive/2009/08/18/9874133.aspx" target=_blank mce_href="http://blogs.msdn.com/ssds/archive/2009/08/18/9874133.aspx"&gt;link&lt;/A&gt; to the SQL Azure team post for information on how to get started.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;SQL Azure, formerly known as SQL Services, is a new &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;relational&lt;/I&gt;&lt;/B&gt; database in the cloud.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It is a specialized version of SQL Server 2008.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In fact, if you execute the command “&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;select&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: fuchsia"&gt;@@version&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;”, you will get back a string that says as much: &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;One of the really neat things about SQL Azure is that you can connect to it using a SQL connection string, much like you would with an on-premise SQL Server.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This works because SQL Azure, much like its non-cloud cousins, comes with TDS support. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;TDS stands for Tabular Data Stream and is an application-level protocol used in communication between client applications and SQL Server.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;TDS packets are encapsulated in the packets built for the protocol stack.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So if you are using the TCP/IP Sockets Net-Library, then TDS packets are encapsulated in the TCP/IP packets.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Because of this, you can use a SQL connection string to connect to SQL Azure from even behind a firewall, provided your firewall settings are not blocking outbound ports. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;Support for TDS means that you will eventually be able to use the same tools you use today when developing against SQL Server.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I say eventually because as of CTP1 of SQL Azure, there are still a few kinks to work out in order to enable full support for tools like SQL Server Management Studio (SSMS).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can still use SSMS today against SQL Azure if you are aware of these kinks and how to work around some of them. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;For the purposes of this post, I’m going to assume you’ve already signed up for the SQL Azure CTP. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;Once you’ve gotten access to SQL Azure, you can navigate to the portal site and from there you can create a database from the Server administration page. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_14.png" mce_href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_14.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb_6.png" width=579 height=395 mce_src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb_6.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;The master database will be the only database listed initially.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I should also mention that you can create a database using SQL as well.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;As I’ve implied, support for tools is still in the works since this is only a CTP, however you can use &lt;B style="mso-bidi-font-weight: normal"&gt;sqlcmd&lt;/B&gt; and SSMS today to do much of what you need to do with SQL Azure. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;The following is an example of the syntax you would use when connecting to SQL Azure using sqlcmd: &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;sqlcmd&lt;/B&gt; -S oup6wnx5kr.ctp.database.windows.net -U mpapas@oup6wnx5kr -P ***********&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;Connecting using SSMS is a bit trickier.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The following are the steps you need to take: &lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;Launch SSMS &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;Cancel the initial “Connect to Server” dialog (support for the Object Explorer in SSMS is not there yet) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;Click on New Query &lt;BR&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_12.png" mce_href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_12.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb_5.png" width=225 height=180 mce_src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb_5.png"&gt;&lt;/A&gt; &lt;BR&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal&gt;&lt;SPAN style="mso-no-proof: yes"&gt;You’ll need to specify SQL Server Authentication and specify the Server Name in the following format &lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;tcp:&amp;lt;your server name&amp;gt;.ctp.database.windows.net&lt;/I&gt;&lt;/B&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Be sure you have support for TCP/IP enabled as a client protocol. &lt;BR&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_10.png" mce_href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_10.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb_4.png" width=421 height=318 mce_src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb_4.png"&gt;&lt;/A&gt; &lt;BR&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;Don’t click Connect just yet.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Instead click on Options &amp;gt;&amp;gt;. &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;If you’ve already created the database using the portal site, type in the name of the database in the Connect to Database combo box.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You won’t be able to see your database in the drop down because support for that just isn’t there yet either. &lt;BR&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_8.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb_3.png" width=385 height=450 mce_src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb_3.png"&gt;&lt;/A&gt; &lt;BR&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;Finally, click Connect. &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;You will see the following dialog pop-up.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is safe to ignore (more CTP goodness I guess). &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal&gt;&lt;A href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_6.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb_2.png" width=584 height=134 mce_src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;And that’s all there is to it.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Now that you have a query window open, you can enter and execute your SQL. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;A href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_4.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb_1.png" width=592 height=462 mce_src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;You can even show the execution plan of your queries: &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;A href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb.png" width=592 height=335 mce_src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/FirstImpressionswiththeNewSQLAzure_C328/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;It’s important to mention that not all T-SQL is supported.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For a list of what is and is not supported, see the &lt;A href="http://msdn.microsoft.com/en-us/library/ee336279.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ee336279.aspx"&gt;SQL Azure documentation on MSDN&lt;/A&gt;. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;In an upcoming blog post, I plan on blogging about my experience with converting NerdDinner to use SQL Azure for its main database instead of Windows Azure Storage. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;EM&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 7.5pt; mso-ansi-language: en; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang=EN&gt;This posting represents the sole opinion of the author and is not the opinion of Microsoft Corporation.&amp;nbsp; This posting is provided "AS IS" with no warranties, and confers no rights.&amp;nbsp; Use of any included samples are subject to the terms specified at &lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt;&lt;A href="http://www.microsoft.com/info/cpyright.htm" mce_href="http://www.microsoft.com/info/cpyright.htm"&gt;&lt;EM&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; COLOR: blue; FONT-SIZE: 7.5pt; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"&gt;http://www.microsoft.com/info/cpyright.htm&lt;/SPAN&gt;&lt;/EM&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 7.5pt; mso-ansi-language: en; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang=EN&gt;.&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN style="mso-ansi-language: en" lang=EN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9872688" width="1" height="1"&gt;</content><author><name>mpapa</name><uri>http://blogs.msdn.com/members/mpapa.aspx</uri></author><category term="SQL Azure" scheme="http://blogs.msdn.com/mpapas/archive/tags/SQL+Azure/default.aspx" /><category term="Windows Azure Platform" scheme="http://blogs.msdn.com/mpapas/archive/tags/Windows+Azure+Platform/default.aspx" /></entry><entry><title>TechReady 9</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mpapas/archive/2009/08/03/techready-9.aspx" /><id>http://blogs.msdn.com/mpapas/archive/2009/08/03/techready-9.aspx</id><published>2009-08-03T19:06:23Z</published><updated>2009-08-03T19:06:23Z</updated><content type="html">&lt;p&gt;What an amazing week it was last week at TechReady 9 in Seattle!&lt;/p&gt;  &lt;p&gt;TechReady is a conference where the Microsoft product teams and the field get to exchange information.&amp;#160; It’s a sort of meeting of the minds.&amp;#160; The product teams, in turn, get to ask questions of the field in order to better understand how products are being leveraged by customers.&lt;/p&gt;  &lt;p&gt;Learning about the enormous amount of innovation coming from the product teams is akin to drinking from a fire hose.&amp;#160; I’m always amazed at the wealth of innovation that flows from these teams.&amp;#160; It’s truly amazing and inspiring to see.&amp;#160; I’m constantly impressed by Microsoft’s ability to envision long-term and align the business and the engineering teams in order to realize, unrelentingly, a set of shared goals.&amp;#160; &lt;/p&gt;  &lt;p&gt;Many people don’t realize the full depth and breadth of innovation that occurs within this company.&amp;#160; It isn’t just Windows and Office.&amp;#160; It isn’t just about the “search war” with Bing.&lt;/p&gt;  &lt;p&gt;These incremental product improvements are about taking steps towards the realization of a future that could be.&amp;#160; Our strength lies in the interwoven tapestry of innovation that spreads between and through our products.&lt;/p&gt;  &lt;p&gt;At the very core, the engine of innovation is Microsoft Research.&amp;#160; I’m truly thankful to be working for a company which is willing to make such long-term strategic investments in not just its future, but the future of the world.&amp;#160; Perhaps I am a little naive, but I really do believe that.&amp;#160; And belief is a powerful motivator for change.&lt;/p&gt;  &lt;p&gt;I wish I could share the little glimpse of the future that I’ve seen while at TechReady, but unfortunately I can’t.&amp;#160; I guess you’ll have to trust me when I tell you that the ride is far from over.&amp;#160; We’re just changing roller coasters, so hang onto your hats.&amp;#160; The best is yet to come.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9856336" width="1" height="1"&gt;</content><author><name>mpapa</name><uri>http://blogs.msdn.com/members/mpapa.aspx</uri></author><category term="Future" scheme="http://blogs.msdn.com/mpapas/archive/tags/Future/default.aspx" /><category term="TechReady" scheme="http://blogs.msdn.com/mpapas/archive/tags/TechReady/default.aspx" /><category term="Vision" scheme="http://blogs.msdn.com/mpapas/archive/tags/Vision/default.aspx" /></entry><entry><title>NerdDinner on Azure</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mpapas/archive/2009/06/25/nerddinner-on-azure.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="1552925" href="http://blogs.msdn.com/mpapas/attachment/9804106.ashx" /><id>http://blogs.msdn.com/mpapas/archive/2009/06/25/nerddinner-on-azure.aspx</id><published>2009-06-25T22:16:00Z</published><updated>2009-06-25T22:16:00Z</updated><content type="html">&lt;P class=MsoNormal&gt;As a first foray into the Microsoft Azure Services Platform, I decided to try my hand at converting an application to run in the Microsoft Cloud.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I chose &lt;A href="http://nerddinner.codeplex.com/" mce_href="http://nerddinner.codeplex.com/"&gt;NerdDinner&lt;/A&gt; as the application to convert because it was a fairly small and easy to understand application.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;NerdDinner was first released as a sample app for the book &lt;A href="http://www.amazon.com/Professional-ASP-NET-MVC-Wrox-Programmer/dp/0470384611/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1245951388&amp;amp;sr=8-1" mce_href="http://www.amazon.com/Professional-ASP-NET-MVC-Wrox-Programmer/dp/0470384611/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1245951388&amp;amp;sr=8-1"&gt;Professional ASP.NET MVC 1.0&lt;/A&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;Configuration&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;Since the ASP.NET MVC bits are not installed on Windows Azure instances, I needed to include a local copy of the DLLs with the project.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;For storage, I planned on using the Windows Azure Table Service for storage.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can access the Table Service API in the following ways:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal&gt;Using the REST API directly, or…&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal&gt;Using the .NET Client Library for ADO.NET Data Services&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal&gt;The .NET Client Library is just a layer on top of the REST API and makes things a little easier.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I decided to use the .NET Client Library so therefore I needed to include a reference to the System.Data.Services.Client namespace.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;I’m also going to include two sample projects into the solution.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;These sample projects came with the &lt;A href="http://msdn.microsoft.com/en-us/library/dd179367.aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd179367.aspx"&gt;Windows Azure SDK&lt;/A&gt; and they are the StorageClient and AspProviders libraries.&lt;/P&gt;
&lt;P class=MsoNormal&gt;The StorageClient is a library that sits between the .NET Client Library for ADO.NET Data Services and the NerdDinner application.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Think of it as a Windows Azure Table Service-specific helper library.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can read more about the sample &lt;A href="http://msdn.microsoft.com/en-us/library/dd135716.aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd135716.aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P class=MsoNormal&gt;The AspProviders project is provides sample implementations of ASP.NET providers that can run on Azure.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Since NerdDinner uses an ASP.NET membership provider, I needed something equivalent.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can read more about that sample &lt;A href="http://msdn.microsoft.com/en-us/library/dd179415.aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd179415.aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P class=MsoNormal&gt;Once these two projects were added to the solution, I added a project reference to each from the NerdDinner project.&lt;/P&gt;
&lt;P class=MsoNormal&gt;I also need to tell Windows Azure a little about the application I wish to host.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is done through a new project type that gets added to Visual Studio when you install the Azure SDK.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What I needed was to add a Blank Cloud Service project type to the solution:&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;A href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/NerdDinneronAzure_C8C8/clip_image002_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/NerdDinneronAzure_C8C8/clip_image002_2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image002 border=0 alt=clip_image002 src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/NerdDinneronAzure_C8C8/clip_image002_thumb.jpg" width=244 height=125 v:shapes="Picture_x0020_1" mce_src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/NerdDinneronAzure_C8C8/clip_image002_thumb.jpg"&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;A Cloud Service project type basically defines what your hosted service looks like to Windows Azure.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Once you have this project type in your solution, you can add Web or Worker roles to it, which are basically references to other projects.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;See &lt;A href="http://msdn.microsoft.com/en-us/library/dd179341.aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd179341.aspx"&gt;Understanding Service Architecture&lt;/A&gt; for more information on Web and Worker roles in Azure.&lt;/P&gt;
&lt;P class=MsoNormal&gt;In order to add NerdDinner as a Web role, I needed to modify the .csproj file to include a &amp;lt;RoleType&amp;gt; element.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For more information on this, see this &lt;A href="http://blogs.msdn.com/jnak/archive/2008/10/28/asp-net-mvc-projects-running-on-windows-azure.aspx" mce_href="http://blogs.msdn.com/jnak/archive/2008/10/28/asp-net-mvc-projects-running-on-windows-azure.aspx"&gt;blog post&lt;/A&gt;.&lt;/P&gt;
&lt;P class=MsoNormal&gt;My final solution structure looked like the following:&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;A href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/NerdDinneronAzure_C8C8/clip_image004_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/NerdDinneronAzure_C8C8/clip_image004_2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image004 border=0 alt=clip_image004 src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/NerdDinneronAzure_C8C8/clip_image004_thumb.jpg" width=244 height=183 v:shapes="Picture_x0020_4" mce_src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/NerdDinneronAzure_C8C8/clip_image004_thumb.jpg"&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;The next step was to modify the Web.config file in NerdDinner.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I needed to tell the app that I wanted to use the TableStorageMembershipProvider instead of the AspNetSqlMembershipProvider.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I also needed to include some basic application settings for local development.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;Initially I put these &amp;lt;appSettings&amp;gt; values in Web.config, but down the road I learned it was better to actually put these values in the local ServiceConfiguration.cscfg file.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The reason for this is that if they are in the .cscfg file, you can update the configuration in the Cloud without having to redeploy your application.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;Therefore, I created another .cscfg file which I added as a Solution Item that I use to configure the application when I deploy it to the Cloud.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The .cscfg file within the NerdDinner_Azure Cloud Service project contains settings for local development.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is convenient because when I run locally, I can just leave those settings alone.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Here is my local ServiceConfiguration.cscfg file:&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&amp;lt;?&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;xml&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;version&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;1.0&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;?&amp;gt; &lt;/SPAN&gt;
&lt;P mce_keep="true"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;ServiceConfiguration&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;serviceName&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;NerdDinner_Azure&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;Role&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Web&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;Instances&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;count&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;1&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;ConfigurationSettings&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;Setting&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;AccountName&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;devstoreaccount1&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;Setting&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;AccountSharedKey&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;Setting&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;TableStorageEndpoint&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;http://127.0.0.1:10002&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;Setting&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;BlobStorageEndpoint&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;http://127.0.0.1:10000/&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;Setting&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;QueueStorageEndpoint&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;http://127.0.0.1:10001&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;ConfigurationSettings&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;Role&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;ServiceConfiguration&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 8pt"&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;Data Model&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;Because the &lt;I style="mso-bidi-font-style: normal"&gt;relational&lt;/I&gt; version of SQL Data Services technology wasn’t available to me yet, I did not want to spend time learning SDS when Azure Table Storage would work just fine for my purpose.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Had the new version of SQL Data Services been available, it would have made this conversion considerably easier as there would have been fewer changes to the model.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Oh well…&lt;/P&gt;
&lt;P class=MsoNormal&gt;Since we can’t use LINQ-to-SQL, I blew away any files associated with that approach and instead created the following classes:&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;A href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/NerdDinneronAzure_C8C8/clip_image006_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/NerdDinneronAzure_C8C8/clip_image006_2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image006 border=0 alt=clip_image006 src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/NerdDinneronAzure_C8C8/clip_image006_thumb.jpg" width=244 height=134 v:shapes="Picture_x0020_7" mce_src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/NerdDinneronAzure_C8C8/clip_image006_thumb.jpg"&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;Note that the entity classes, Dinner and RSVP, derive from TableStorageEntity and that NerdDinnerDataContext derives from TableStorageDataServiceContext.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;These base classes are part of the StorageClient library.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;From the class TableStorageEntity, the entity classes inherit the PartitionKey, RowKey and Timestamp properties.&lt;/P&gt;
&lt;P class=MsoNormal&gt;The PartitionKey and RowKey properties are required when using the Windows Azure Table Service.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;These are strings and together form the unique key for an entity.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;Choosing PartitionKey and RowKey values can have significant implications in scalability, which I won’t go into here.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;For my purposes, I decided on the following PartitionKey and RowKey combinations for the entites:&lt;/P&gt;
&lt;TABLE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; BORDER-COLLAPSE: collapse; BORDER-TOP: medium none; BORDER-RIGHT: medium none; mso-border-alt: solid #4f81bd 1.0pt; mso-border-themecolor: accent1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" class=MsoTableLightListAccent1 border=1 cellSpacing=0 cellPadding=0 class="MsoTableLightListAccent1"&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: -1; mso-yfti-firstrow: yes"&gt;
&lt;TD style="BORDER-BOTTOM: medium none; BORDER-LEFT: #4f81bd 1pt solid; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #4f81bd; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-top-themecolor: accent1; mso-border-left-themecolor: accent1; mso-background-themecolor: accent1" vAlign=top&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt; mso-yfti-cnfc: 5" class=MsoNormal&gt;&lt;SPAN style="COLOR: white; mso-themecolor: background1; mso-bidi-font-weight: bold"&gt;Entity &lt;/SPAN&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #4f81bd; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-top-themecolor: accent1; mso-background-themecolor: accent1" vAlign=top&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt; mso-yfti-cnfc: 1" class=MsoNormal&gt;&lt;SPAN style="COLOR: white; mso-themecolor: background1; mso-bidi-font-weight: bold"&gt;PartitionKey &lt;/SPAN&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; BACKGROUND: #4f81bd; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: #4f81bd 1pt solid; PADDING-TOP: 0in; mso-border-top-themecolor: accent1; mso-background-themecolor: accent1; mso-border-right-themecolor: accent1" vAlign=top&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt; mso-yfti-cnfc: 1" class=MsoNormal&gt;&lt;SPAN style="COLOR: white; mso-themecolor: background1; mso-bidi-font-weight: bold"&gt;RowKey &lt;/SPAN&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 0"&gt;
&lt;TD style="BORDER-BOTTOM: #4f81bd 1pt solid; BORDER-LEFT: #4f81bd 1pt solid; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-themecolor: accent1" vAlign=top&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt; mso-yfti-cnfc: 68" class=MsoNormal&gt;&lt;B&gt;Dinner &lt;/B&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: #4f81bd 1pt solid; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-top-themecolor: accent1; mso-border-bottom-themecolor: accent1" vAlign=top&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt; mso-yfti-cnfc: 64" class=MsoNormal&gt;Dinner.EventDate &lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: #4f81bd 1pt solid; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: #4f81bd 1pt solid; BORDER-RIGHT: #4f81bd 1pt solid; PADDING-TOP: 0in; mso-border-themecolor: accent1" vAlign=top&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt; mso-yfti-cnfc: 64" class=MsoNormal&gt;Dinner.HostedBy&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 1; mso-yfti-lastrow: yes"&gt;
&lt;TD style="BORDER-BOTTOM: #4f81bd 1pt solid; BORDER-LEFT: #4f81bd 1pt solid; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-left-themecolor: accent1; mso-border-bottom-themecolor: accent1" vAlign=top&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt; mso-yfti-cnfc: 4" class=MsoNormal&gt;&lt;B&gt;RSVP &lt;/B&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: #4f81bd 1pt solid; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0in; mso-border-bottom-themecolor: accent1" vAlign=top&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal&gt;Dinner.EventDate &lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: #4f81bd 1pt solid; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; BORDER-TOP: medium none; BORDER-RIGHT: #4f81bd 1pt solid; PADDING-TOP: 0in; mso-border-right-themecolor: accent1; mso-border-bottom-themecolor: accent1" vAlign=top&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal&gt;RSVP.RsvpDate + “-“ + RSVP.AttendeeName&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Since I now had to refer to entities by using PartitionKey and RowKey, I had to modify the Controller classes and Views in NerdDinner to refer to an entity using this combined key.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I also had to modify the ViewDataModel classes as well as the JsonDinner class representing the JSON data structure used during the AJAX requests.&lt;/P&gt;
&lt;P class=MsoNormal&gt;Also, because of the limitations inherent with the current version of the Windows Azure Table Service, I had to get a little creative in the data access functionality.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For instance, the OrderBy LINQ operator is not supported by the Table Service.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Therefore, I had to make sure that the ordering of the sequence in my LINQ queries was done in memory and not remotely.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Here’s a little trick that worked nicely for me in one of the controllers:&lt;/P&gt;
&lt;P class=MsoNormal mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;IEnumerable&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;Dinner&lt;/SPAN&gt;&amp;gt; dinners = dinnerRepository.FindUpcomingDinners().AsEnumerable().OrderBy(dinner =&amp;gt; dinner.EventDate);&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 8pt"&gt; &lt;/SPAN&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;I used AsEnumerable() to hide the custom operators and instead make the standard query operators available to me.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This forced the query to execute and allowed me to use an in-memory sequence for the OrderBy method call as you see in the method syntax I’m using above.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I could have also called ToList&amp;lt;T&amp;gt; or ToArray&amp;lt;T&amp;gt; to force immediate execution and cache the results in memory before calling OrderyBy.&lt;/P&gt;
&lt;P class=MsoNormal&gt;Since the Count operator is also not supported, I had to work around that as well.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Who would have thought it would be that difficult to ask for the RSVP count?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Well, once you know the tricks, it’s not that bad, but it sure would have made it A LOT easier if these aggregate functions were supported out-of-the-box.&lt;/P&gt;
&lt;P class=MsoNormal&gt;Unfortunately it was getting very late by the time I got to the paging functionality, so paging through a dinner list is not supported at this point.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’ll let the reader figure that one out &lt;SPAN style="FONT-FAMILY: wingdings; mso-ascii-font-family: calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: calibri; mso-hansi-theme-font: minor-latin; mso-char-type: symbol; mso-symbol-font-family: wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: wingdings"&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9804106" width="1" height="1"&gt;</content><author><name>mpapa</name><uri>http://blogs.msdn.com/members/mpapa.aspx</uri></author><category term="Windows Azure Platform" scheme="http://blogs.msdn.com/mpapas/archive/tags/Windows+Azure+Platform/default.aspx" /><category term="Windows Azure Table Storage" scheme="http://blogs.msdn.com/mpapas/archive/tags/Windows+Azure+Table+Storage/default.aspx" /></entry><entry><title>Extension Methods are Wonderful</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mpapas/archive/2009/05/15/extension-methods-are-wonderful.aspx" /><id>http://blogs.msdn.com/mpapas/archive/2009/05/15/extension-methods-are-wonderful.aspx</id><published>2009-05-15T21:06:26Z</published><updated>2009-05-15T21:06:26Z</updated><content type="html">&lt;p&gt;Extension methods are a feature of C# 3.0 that is just one of those features which can be easily overlooked.&amp;nbsp; &lt;/p&gt; &lt;p&gt;A lot of .NET old-timers, like myself, who are particularly kept busy on a daily basis trying to meet a project deadline or build the next biggest, baddest Line of Business application (wow.. that just sounds soo sexy doesn’t it?) will often fall back on old practices.&amp;nbsp; .NET has trained me to often create a number of helper classes, such as a StringValidationHelper etc., in order to do things like validating user-entered data.&amp;nbsp; So for instance, I could have a class that looks like the following:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/ExtensionMethodsareWonderful_B83A/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/ExtensionMethodsareWonderful_B83A/image_thumb.png" width="484" height="147"&gt;&lt;/a&gt;  &lt;p&gt;And here’s how you use it:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/ExtensionMethodsareWonderful_B83A/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/ExtensionMethodsareWonderful_B83A/image_thumb_1.png" width="328" height="67"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Nothing too exciting here so far…&amp;nbsp; &lt;/p&gt; &lt;p&gt;But watch out! Here come Extension Methods!&lt;/p&gt; &lt;p&gt;With Extension Methods, I can change add a method onto the string class itself.&amp;nbsp; And it doesn’t matter if the class is sealed!&amp;nbsp; &lt;/p&gt; &lt;p&gt;Here’s my adjusted StringHelper class:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/ExtensionMethodsareWonderful_B83A/image_6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/ExtensionMethodsareWonderful_B83A/image_thumb_2.png" width="484" height="147"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Notice that all I had to do was add the keyword &lt;em&gt;this&lt;/em&gt; before the string data argument.&lt;/p&gt; &lt;p&gt;Now I can use the IsValidPhoneNumber method directly from my string variable:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/ExtensionMethodsareWonderful_B83A/image_8.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mpapas/WindowsLiveWriter/ExtensionMethodsareWonderful_B83A/image_thumb_3.png" width="240" height="69"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Ah.. that’s more like it.&amp;nbsp; This code now looks a lot less cluttered.&lt;/p&gt; &lt;p&gt;Of course this is a contrived example but nevertheless illustrates how easy it is to use this very cool feature of C#.&lt;/p&gt; &lt;p&gt;Some of you who have been using LINQ may not realize that LINQ itself heavily uses Extension Methods, particularly on the IEnumerable interface.&amp;nbsp; This occurs when you import the System.Linq namespace.&amp;nbsp; Try it out – look at the IEnumerable interface intellisense before and after you import the System.Linq namespace. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9619014" width="1" height="1"&gt;</content><author><name>mpapa</name><uri>http://blogs.msdn.com/members/mpapa.aspx</uri></author><category term="Extension Methods" scheme="http://blogs.msdn.com/mpapas/archive/tags/Extension+Methods/default.aspx" /><category term="C#" scheme="http://blogs.msdn.com/mpapas/archive/tags/C_2300_/default.aspx" /><category term="IEnumerable" scheme="http://blogs.msdn.com/mpapas/archive/tags/IEnumerable/default.aspx" /><category term="LINQ" scheme="http://blogs.msdn.com/mpapas/archive/tags/LINQ/default.aspx" /></entry></feed>