<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Brian Ritchie</title><link>https://weblogs.asp.net:443/britchie/</link><description>Blogging on .NET &amp; technology</description><item><title>5 steps to better software estimates</title><link>https://weblogs.asp.net:443/britchie/5-steps-to-better-software-estimates</link><description>&lt;p&gt;Schedules are critical to business. They help us plan and coordinate efforts across teams.&amp;nbsp; The problem with schedules is they are based on estimates.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In software development, estimates are challenging. A new section of code is rarely identical to past work, making comparisons difficult. To make matters worse, the new code usually integrates with or modifies existing code.&amp;nbsp; This is where things usually go sideways. And if that doesn't do it, there are usually the unexpected build issues, deployment problems, or various interruptions.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here are some ideas to help with your estimates...&lt;/p&gt;
&lt;p&gt;Read Full Post:&amp;nbsp;&lt;a href="https://www.linkedin.com/pulse/5-steps-better-software-estimates-brian-ritchie"&gt;https://www.linkedin.com/pulse/5-steps-better-software-estimates-brian-ritchie&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;</description><pubDate>Mon, 14 Mar 2016 14:36:02 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/5-steps-to-better-software-estimates</guid><category>General Software Development</category><category>Development Article</category><category>Estimating</category><category>Process</category></item><item><title>The fallacies of distributed computing</title><link>https://weblogs.asp.net:443/britchie/the-fallacies-of-distributed-computing</link><description>&lt;p&gt;Building distributed systems can be complex undertaking. This makes solid architecture, design, coding, and testing all critical to success. Failure at any of these points can lead to degraded performance, unhandled failures, unplanned expenses required to redesign the system, and ultimately lost customers.&lt;/p&gt;
&lt;p&gt;The eight fallacies of distributed computing were asserted by Peter Deutsch, James Gosling and others at Sun Microsystems. These false assumptions serve as a guide and warning to all of us building distributed systems.&lt;/p&gt;
&lt;p&gt;The eight fallacies are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The network is reliable.&lt;/li&gt;
&lt;li&gt;Latency is zero.&lt;/li&gt;
&lt;li&gt;Bandwidth is infinite.&lt;/li&gt;
&lt;li&gt;The network is secure.&lt;/li&gt;
&lt;li&gt;Topology doesn't change.&lt;/li&gt;
&lt;li&gt;There is one administrator.&lt;/li&gt;
&lt;li&gt;Transport cost is zero.&lt;/li&gt;
&lt;li&gt;The network is homogeneous.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;While this guidance was laid out twenty years ago, we are still making these mistakes today. These mistakes show up as unsecured endpoints, timeouts due to serialization of large objects, lost transactions, slow performance, and more. Averting these mistakes means considering these fallacies during every design and code review. It is critical that we challenge our teams to make this part of their DNA.&lt;/p&gt;
&lt;p&gt;To learn more, please referrer to this white paper:&lt;br /&gt;&lt;a href="http://www.rgoarchitects.com/Files/fallacies.pdf"&gt;http://www.rgoarchitects.com/Files/fallacies.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;</description><pubDate>Sat, 05 Mar 2016 23:35:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/the-fallacies-of-distributed-computing</guid><category>Distributed systems</category><category>General Software Development</category><category>Architecture</category><category>Development Article</category></item><item><title>Packt offers buy one, get one free book offer</title><link>https://weblogs.asp.net:443/britchie/packt-offers-buy-one-get-one-free-book-offer</link><description>&lt;p&gt;Packt Publishing has published their 2000th book!&amp;nbsp; You can buy my book &lt;a href="http://goo.gl/mF5yi5" mce_href="http://goo.gl/mF5yi5"&gt;RavenDB: High Performance&lt;/a&gt; and many more from Packt in this amazing Buy One, Get One Free offer&amp;nbsp; http://bit.ly/1j26nPN&lt;/p&gt;&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/britchie/2000th-Book-Home-Page-Banner.png"&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/britchie/Media/2000th-Book-Home-Page-Banner.png" border="0"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;script id="ncoEventScript" type="text/javascript"&gt;function DOMContentLoaded(browserID, tabId, isTop, url) { var object = document.getElementById("cosymantecnisbfw"); if(null != object) { object.DOMContentLoaded(browserID, tabId, isTop, url);} };
function Nav(BrowserID, TabID, isTop, isBool, url) { var object = document.getElementById("cosymantecnisbfw"); if(null != object) object.Nav(BrowserID, TabID, isTop, isBool, url); };
function NavigateComplete(BrowserID, TabID, isTop, url) { var object = document.getElementById("cosymantecnisbfw"); if(null != object) object.NavigateComplete(BrowserID, TabID, isTop, url); }
function Submit(browserID, tabID, target, url) { var object = document.getElementById("cosymantecnisbfw"); if(null != object) object.Submit(browserID, tabID, target, url); };
&lt;/script&gt;</description><pubDate>Wed, 26 Mar 2014 03:50:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/packt-offers-buy-one-get-one-free-book-offer</guid><category>General Software Development</category><category>RavenDB</category></item><item><title>Playing Spotify (and other audio) via AirPlay</title><link>https://weblogs.asp.net:443/britchie/playing-spotify-and-other-audio-via-airplay</link><description>&lt;p&gt;Two of my favorite things working together: &lt;a href="https://www.spotify.com/" mce_href="https://www.spotify.com/"&gt;Spotify&lt;/a&gt; &amp;amp; &lt;a href="http://www.apple.com/airplay/" mce_href="http://www.apple.com/airplay/"&gt;AirPlay&lt;/a&gt;.&amp;nbsp; This tip lets you play your Spotify library for free on your home theatre!&amp;nbsp; &lt;/p&gt;&lt;p&gt;If you have a Mac, simply hold down the option key when you click on the audio menu option.&amp;nbsp; You can then send just the audio to an Apple TV or AirPort.&amp;nbsp; If you're on Windows, you'll need to use something like &lt;a href="https://rogueamoeba.com/airfoil/windows/" mce_href="https://rogueamoeba.com/airfoil/windows/"&gt;Airfoil for Windows&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/britchie/Mac-AirPlay2.png"&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/britchie/Media/Mac-AirPlay2.png" border="0"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Take a look at this &lt;a href="http://www.cultofmac.com/213986/mastering-the-option-key-on-your-os-x-mac-feature/" mce_href="http://www.cultofmac.com/213986/mastering-the-option-key-on-your-os-x-mac-feature/"&gt;article&lt;/a&gt; from Cult of Mac for other cool uses for the option key. &lt;br&gt;&lt;/p&gt;</description><pubDate>Tue, 17 Dec 2013 02:48:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/playing-spotify-and-other-audio-via-airplay</guid><category>AirPlay</category><category>Apple</category><category>Spotify</category></item><item><title>Reviews: RavenDB High Performance</title><link>https://weblogs.asp.net:443/britchie/reviews-ravendb-high-performance</link><description>&lt;p&gt;My book &lt;a href="http://goo.gl/mF5yi5" mce_href="http://goo.gl/mF5yi5"&gt;RavenDB High Performance&lt;/a&gt; was recently published by &lt;a href="http://www.packtpub.com/" mce_href="http://www.packtpub.com/"&gt;Packt Publishing&lt;/a&gt;. The team at Packt was great to work with and I had support from a strong group of reviewers: &lt;a href="http://ayende.com/blog" mce_href="http://ayende.com/blog"&gt;Ayende Rahien&lt;/a&gt; (of &lt;a href="http://ravendb.net/" mce_href="http://ravendb.net/"&gt;RavenDB&lt;/a&gt; fame), Paul Stovell (founder of &lt;a href="http://octopusdeploy.com/" mce_href="http://octopusdeploy.com/"&gt;Octopus Deploy&lt;/a&gt;), and Mohammed Ibrahim.&lt;/p&gt;&lt;p&gt;I really enjoyed writing the book and hope that readers enjoy reading 
it! The goal of the book was to dig into the advanced topics that would 
help developers take their applications to the next level.&amp;nbsp; Once you get
 the basics down, this book will help you optimize your applications for higher levels of scalability and functionality. &lt;/p&gt;&lt;p&gt;Need more encouragement to get a &lt;a href="http://goo.gl/mF5yi5" mce_href="http://goo.gl/mF5yi5"&gt;copy&lt;/a&gt;?&amp;nbsp; :)&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Ayende Rahien&lt;/b&gt;&lt;br&gt;"To summarize, go ahead and do the cool stuff first. But pay attention to the whole book. I think that Brian has done an excellent job in getting the crucial information you need to really get the most from RavenDB. And this book is one of the best ways to go from being merely proficient to being absolutely awesome." [ From the book's forward ]&lt;br&gt;&lt;br&gt;&lt;b&gt;&lt;b&gt;Brian Federici&lt;/b&gt;&lt;br&gt;&lt;/b&gt;"In some ways, I found the book easier to follow
 than the online RavenDB documentation. While it's not extensive enough 
to replace the online docs, I found the organization of the book to be 
more logical and it did a better job of surfacing the core knowledge 
you'd need day-to-day." [ &lt;a href="http://brian-federici.com/blog/2013/12/01/review-of-ravendb-high-performance"&gt;Full Review&lt;/a&gt; ]&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Sebastian Gebski&lt;/b&gt;&lt;br&gt;"The best book on RavenDB that is available currently (but not for absolute beginners!) This book is a clear win - it's a short but very practical guide to the most crucial aspects of RavenDB. To summarize: if you're considering RavenDB for your product / service, give this book a go, it will help you to understand what's Raven capable of." [ &lt;a href="http://www.amazon.com/review/R3N3JUZDFYXET0/" mce_href="http://www.amazon.com/review/R3N3JUZDFYXET0/"&gt;Full Review&lt;/a&gt; ]&lt;br&gt;&lt;br&gt;&lt;b&gt;Johnny Graber&lt;/b&gt;&lt;br&gt;"There are many tricks to squeeze more performance out of the API. Most of them are not part of the official documentation and when only as a comment to a more general topic. Brian made a big effort to collect them. And luckily for us he can explain them in a beginner-friendly way as well." [ &lt;a href="http://improveandrepeat.com/2013/11/book-review-ravendb-high-performance/" mce_href="http://improveandrepeat.com/2013/11/book-review-ravendb-high-performance/"&gt;Full Review&lt;/a&gt; ]&lt;br&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;I really appreciate the kind words of these reviewers.&amp;nbsp; This is my first book and I tried to pour into it the things that I would want to learn if I were buying a book on &lt;a href="http://ravendb.net/" mce_href="http://ravendb.net/"&gt;RavenDB&lt;/a&gt;.&amp;nbsp; Please &lt;a href="http://goo.gl/mF5yi5" mce_href="http://goo.gl/mF5yi5"&gt;check it out&lt;/a&gt; and let me know what you think.&lt;br&gt;&lt;script id="ncoEventScript" type="text/javascript"&gt;Ifunction DOMContentLoaded(browserID, tabId, isTop, url) { var object = document.getElementById("cosymantecnisbfw"); if(null != object) { object.DOMContentLoaded(browserID, tabId, isTop, url);} };
function Nav(BrowserID, TabID, isTop, isBool, url) { var object = document.getElementById("cosymantecnisbfw"); if(null != object) object.Nav(BrowserID, TabID, isTop, isBool, url); };
function NavigateComplete(BrowserID, TabID, isTop, url) { var object = document.getElementById("cosymantecnisbfw"); if(null != object) object.NavigateComplete(BrowserID, TabID, isTop, url); }
function Submit(browserID, tabID, target, url) { var object = document.getElementById("cosymantecnisbfw"); if(null != object) object.Submit(browserID, tabID, target, url); };
&lt;/script&gt;&lt;/p&gt;</description><pubDate>Fri, 13 Dec 2013 02:39:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/reviews-ravendb-high-performance</guid><category>ASP.NET SignalR</category><category>C#</category><category>RavenDB</category></item><item><title>Moving from an entity model to a RavenDB document model</title><link>https://weblogs.asp.net:443/britchie/modeling-documents</link><description>&lt;p mce_keep="true"&gt;I have an application that I'm moving from a SQL Server database to a &lt;a href="http://ravendb.net/" mce_href="http://ravendb.net/"&gt;RavenDB&lt;/a&gt; Document Database.&amp;nbsp;The first order of business is updating the data model. Document data modeling and relational data modeling&amp;nbsp;are totally different.&lt;/p&gt;&lt;p mce_keep="true"&gt;Below is part of the data model.&amp;nbsp; It contains the relationship between &lt;strong&gt;Camps&lt;/strong&gt; &amp;amp; &lt;strong&gt;Programs&lt;/strong&gt;.&amp;nbsp; For this application, a camp can have multiple programs.&amp;nbsp; A program is a specific type of activity program for a given age or grade.&amp;nbsp; For example, a sports summer camp may have a baseball program for 2nd to 4th grade.&amp;nbsp; In a relational database this concept is actually fairly complex to model.&lt;/p&gt;&lt;p mce_keep="true"&gt;&lt;strong&gt;&lt;u&gt;Entity Relationship Model&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p mce_keep="true"&gt;&lt;a href="https://aspblogs.blob.core.windows.net/media/britchie/Media/Camp-ERD.png"&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/britchie/Media/Camp-ERD.png" border="0"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p mce_keep="true"&gt;While the relational database model is fairly complex and will require lots of joins to access, the corresponding document data model is nice and simple.&amp;nbsp;&lt;/p&gt;&lt;p mce_keep="true"&gt;&lt;strong&gt;&lt;u&gt;Document Data Model&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p mce_keep="true"&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/britchie/Media/Camp-DDM.png" mce_src="https://aspblogs.blob.core.windows.net/media/britchie/Media/Camp-DDM.png"&gt;&lt;/p&gt;&lt;p mce_keep="true"&gt;There are two documents.&amp;nbsp; The Camp document contains a collections of references to the related Program document.&amp;nbsp; While you could model this as one big document, the application allows users to search at the Program level &amp;amp; schedules Campers at the program level.  This is why the Program document is separate.&lt;/p&gt;&lt;p mce_keep="true"&gt;The JSON for a &lt;strong&gt;Camp&lt;/strong&gt;&amp;nbsp;looks like the following:&amp;nbsp;&lt;/p&gt;&lt;p mce_keep="true"&gt;camps/ce87d45b-87dc-4d23-a67e-06de97235d8b&lt;br&gt;{&lt;br&gt;&amp;nbsp; "Name": "High School Sports Camp",&lt;br&gt;&amp;nbsp; "Contacts": [&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Type": "Staff",&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Name": "Kathleen Smith",&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "EmailAdress": "katsmith9919@gmail.com"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp; ],&lt;br&gt;&amp;nbsp; "Programs": [&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Id": "programs/75df8120-5f98-479f-bb2c-b0748b6c063d",&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Name": "Baseball Camp - Session 1"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Id": "programs/762ee139-5470-4eb6-9142-501e217c26f0",&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Name": "Baseball Camp - Session 2"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp; ]&lt;br&gt;}&lt;/p&gt;&lt;p mce_keep="true"&gt;And the JSON for a&amp;nbsp;related &lt;strong&gt;Program&lt;/strong&gt;:&amp;nbsp;&lt;/p&gt;&lt;p mce_keep="true"&gt;programs/762ee139-5470-4eb6-9142-501e217c26f0&lt;br&gt;{&lt;br&gt;&amp;nbsp; "CampId": "camps/ce87d45b-87dc-4d23-a67e-06de97235d8b",&lt;br&gt;&amp;nbsp; "CampName": "High School Sports Camp",&lt;br&gt;&amp;nbsp; "Category": "Sports",&lt;br&gt;&amp;nbsp; "Name": "Baseball Camp - Session 2",&lt;br&gt;&amp;nbsp; "Ages": [],&lt;br&gt;&amp;nbsp; "Grades": [&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&lt;br&gt;&amp;nbsp; ]&lt;br&gt;}&lt;/p&gt;&lt;p mce_keep="true"&gt;The nice thing about document models is you can also denormalize data to improve access.&amp;nbsp; In this example, I've included the Camp Name in the Program Document and the Program Name in the Camp document.&amp;nbsp; This saves additional document loads to get basic information.&lt;/p&gt;&lt;p mce_keep="true"&gt;Hopefully this gives you some insight into document data modeling.&amp;nbsp;It is key to&amp;nbsp;building an efficient, easy to develop applications.&amp;nbsp; &lt;/p&gt;&lt;p mce_keep="true"&gt;My new book, &lt;a href="http://goo.gl/mF5yi5" mce_href="http://goo.gl/mF5yi5"&gt;&lt;strong&gt;RavenDB High Performance&lt;/strong&gt;&lt;/a&gt;, covers this topic in depth and much more.&amp;nbsp; I encourage you to check it out if you are building document databases.&lt;/p&gt;&lt;p mce_keep="true"&gt;&lt;a href="http://goo.gl/mF5yi5" mce_href="http://goo.gl/mF5yi5"&gt;&lt;img width="200" height="241" style="width: 200px; height: 241px;" src="https://aspblogs.blob.core.windows.net/media/britchie/Media/ravendb-book.png" border="0" mce_src="https://aspblogs.blob.core.windows.net/media/britchie/Media/ravendb-book.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;</description><pubDate>Sun, 15 Sep 2013 03:06:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/modeling-documents</guid><category>C#</category><category>Document Databases</category><category>JSON</category><category>RavenDB</category></item><item><title>A technique for computed columns in LINQ-based EF queries</title><link>https://weblogs.asp.net:443/britchie/a-technique-for-computed-columns-in-linq-based-ef-queries</link><description>&lt;p mce_keep="true"&gt;Have you seen this message before?&amp;nbsp;&lt;/p&gt;&lt;p mce_keep="true"&gt;LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.&lt;/p&gt;&lt;p mce_keep="true"&gt;It is one of my favorite LINQ to EF messages! LINQ is pretty smart at translating C# expressions into SQL.&amp;nbsp; But, there are lots of simple things that can blow its mind.&amp;nbsp; Here is an example:&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var camps = from c in db.Camps&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select new { &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CampId = "camps/"+c.CampId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&lt;/p&gt;&lt;p mce_keep="true"&gt;This error will occur if CampId is a Guid.&amp;nbsp; It can also occur if you are trying to call a function or perform some sort of complex manipulation.&lt;/p&gt;&lt;p mce_keep="true"&gt;A easy way to solve this problem is to put the results of the query into a class with computed properties.&amp;nbsp;&amp;nbsp;It might be tempting to put this logic into a constructor.  However, LINQ to EF only supports parameterless constructors so this would be a no-go.&lt;/p&gt;&lt;p mce_keep="true"&gt;Here is an example:&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&amp;nbsp; public class&amp;nbsp;Camp&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&amp;nbsp;string CampId { get; set; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Guid CampGuid&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CampId = "camps/" + value;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&amp;nbsp; var camps = from c in db.Camps&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select new Camp&amp;nbsp;{ &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CampGuid = c.CampId&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/p&gt;&lt;p mce_keep="true"&gt;The nice thing about this approach is the CampGuid property won't be serialized to JSON since it only has a setter.&lt;/p&gt;&lt;p mce_keep="true"&gt;Alternatively, you could have the getter do the calculation:&amp;nbsp;&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&amp;nbsp; public class&amp;nbsp;Camp&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&amp;nbsp;string CampId&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;"camps/" + CampGuid;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Guid CampGuid { get; set; }&lt;br&gt;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;&lt;p mce_keep="true"&gt;This even works with more complex examples.&amp;nbsp; In this case, I have a model that is being serialized to JSON.&amp;nbsp; The JavaScript is expecting the dates in Unix format, while EF returns the dates in a C# DateTime class.&amp;nbsp; The same technique can solve this problem as well:&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class CalendarEventModel&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private long ToUnixTimespan(DateTime date)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TimeSpan tspan = date.ToUniversalTime().Subtract(new DateTime(1970, 1, 1, 0, 0, 0));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (long)Math.Truncate(tspan.TotalSeconds);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DateTime startDT { get; set; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DateTime endDT { get; set; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public long start { get { return ToUnixTimespan(startDT); } }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public long end { get { return ToUnixTimespan(endDT); } }&lt;br&gt;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var q = from schedule in db.CamperSchedules&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select new CalendarEventModel()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; startDT = schedule.StartDateTime,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endDT = schedule.EndDateTime&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;br&gt;&lt;/p&gt;</description><pubDate>Fri, 13 Sep 2013 02:21:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/a-technique-for-computed-columns-in-linq-based-ef-queries</guid><category>C#</category><category>EF</category><category>LINQ</category></item><item><title>Creating your development home page using GitHub Pages</title><link>https://weblogs.asp.net:443/britchie/creating-your-development-home-page-using-github-pages</link><description>&lt;p&gt;It was time to update my &lt;a href="http://www.dotnetpowered.com" mce_href="http://www.dotnetpowered.com"&gt;developer home page&lt;/a&gt;.&amp;nbsp; In the past, I've been focused on using server-side technology to create the page.&amp;nbsp; However, times have changes &amp;amp; the server-side isn't all that important for this site. It was more important to have something that was easy to maintain &amp;amp; super-low cost.&lt;/p&gt;&lt;p&gt;Enter &lt;b&gt;GitHub Pages&lt;/b&gt;. It gives you versioning, automated publishing, custom domain names, and it is free!&lt;/p&gt;&lt;p&gt;Here is my new site using responsive (and mobile friendly) HTML5 site beside my old and busted site. &lt;br&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;img src="https://aspblogs.blob.core.windows.net/media/britchie/Media/dotnetpowered-compare.png" mce_src="https://aspblogs.blob.core.windows.net/media/britchie/Media/dotnetpowered-compare.png" height="263" width="576"&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;To setup the site with &lt;a href="http://www.github.com" mce_href="http://www.github.com"&gt;GitHub&lt;/a&gt;:&lt;br&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Create a new repository.&amp;nbsp; I called mine "&lt;a href="https://github.com/dotnetpowered/pages" mce_href="https://github.com/dotnetpowered/pages"&gt;pages&lt;/a&gt;".&amp;nbsp;&lt;/li&gt;&lt;li&gt;If you want to use a built-in template, click Settings-&amp;gt;Automatic Page Generator&lt;br&gt;see &lt;a href="https://help.github.com/articles/creating-pages-with-the-automatic-generator" mce_href="https://help.github.com/articles/creating-pages-with-the-automatic-generator"&gt;https://help.github.com/articles/creating-pages-with-the-automatic-generator&lt;/a&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;If you want to upload your own HTML, create a branch called gh-pages, clone the branch and commit your files&lt;br&gt;see &lt;a href="https://help.github.com/articles/creating-project-pages-manually" mce_href="https://help.github.com/articles/creating-project-pages-manually"&gt;https://help.github.com/articles/creating-project-pages-manually&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Now your site is available at http://username.github.io/projectname. In my case, &lt;a href="http://dotnetpowered.github.io/pages" mce_href="http://dotnetpowered.github.io/pages"&gt;http://dotnetpowered.github.io/pages&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;&lt;p&gt;If you want to point your own domain, create a CNAME file in the root 
folder containing your domain name.&amp;nbsp; Next, point your DNS A record at 204.232.175.78. See &lt;a href="https://help.github.com/articles/setting-up-a-custom-domain-with-pages" mce_href="https://help.github.com/articles/setting-up-a-custom-domain-with-pages"&gt;https://help.github.com/articles/setting-up-a-custom-domain-with-pages&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/britchie/Media/github-pages.png" mce_src="https://aspblogs.blob.core.windows.net/media/britchie/Media/github-pages.png" height="273" width="600"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Learn more about this functionality at &lt;a href="http://pages.github.com" mce_href="http://pages.github.com"&gt;http://pages.github.com&lt;/a&gt;. See my &lt;a href="https://github.com/dotnetpowered/pages" mce_href="https://github.com/dotnetpowered/pages"&gt;repository for an example&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;</description><pubDate>Mon, 09 Sep 2013 00:52:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/creating-your-development-home-page-using-github-pages</guid><category>General Software Development</category><category>GitHub</category><category>HTML5</category><category>Mobile</category></item><item><title>CQRS at Jax Code Camp 2012</title><link>https://weblogs.asp.net:443/britchie/jax-code-camp-2012-cqrs-presentation</link><description>&lt;p&gt;Continuing my &lt;a href="/britchie/archive/2012/02/27/come-out-for-a-cqrs-presentation-at-the-jax-architecture-group.aspx" mce_href="/britchie/archive/2012/02/27/come-out-for-a-cqrs-presentation-at-the-jax-architecture-group.aspx"&gt;CQRS world&amp;nbsp;tour&lt;/a&gt;...I gave my CQRS presentation at the &lt;a href="http://www.jaxdug.net/CodeCamp" mce_href="http://www.jaxdug.net/CodeCamp"&gt;Jax Code Camp 2012&lt;/a&gt; this past Saturday. &amp;nbsp;It was a great crowd with lots of representation from the wicked smart engineers at &lt;a href="http://www.feature23.com" mce_href="http://www.feature23.com"&gt;Feature[23]&lt;/a&gt;&amp;nbsp;and others from the Jacksonville developer community.

&lt;/p&gt;&lt;p&gt;If you'd like to take a look at my slide deck, they are &lt;a href="http://www.slideshare.net/brianritchie1/cqrs-command-query-responsibility-segregation" mce_href="http://www.slideshare.net/brianritchie1/cqrs-command-query-responsibility-segregation"&gt;out on SlideShare&lt;/a&gt;.

The code I demoed is from Ashic Mahtab&amp;nbsp;and is &lt;a href="http://channel9.msdn.com/Events/aspConf/aspConf/CQRS-with-ASP-NET-MVC-A-Year-On" mce_href="http://channel9.msdn.com/Events/aspConf/aspConf/CQRS-with-ASP-NET-MVC-A-Year-On"&gt;posted on&amp;nbsp;github&lt;/a&gt;.&amp;nbsp;&amp;nbsp;
&lt;/p&gt;&lt;p&gt;If you can't get enough of CQRS, Microsoft has joined the CQRS party with their &lt;a href="http://msdn.microsoft.com/en-us/library/jj554200.aspx" mce_href="http://msdn.microsoft.com/en-us/library/jj554200.aspx"&gt;CQRS Journey&lt;/a&gt;&amp;nbsp;which includes a free e-book called&amp;nbsp;&lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=34774" mce_href="http://www.microsoft.com/en-us/download/details.aspx?id=34774"&gt;Exploring CQRS and Event Sourcing&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 10 Oct 2012 04:53:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/jax-code-camp-2012-cqrs-presentation</guid><category>.NET</category><category>C#</category><category>CQRS</category></item><item><title>Come out for a CQRS presentation at the JAX Architecture Group</title><link>https://weblogs.asp.net:443/britchie/come-out-for-a-cqrs-presentation-at-the-jax-architecture-group</link><description>&lt;p&gt;I'm giving a talk on &lt;a href="http://jaxarcsig.wordpress.com/2012/02/02/jacksonville-software-architecture-sig-february-meeting-tuesday-feburary-28th-at-630-pm/" target="_blank" mce_href="http://jaxarcsig.wordpress.com/2012/02/02/jacksonville-software-architecture-sig-february-meeting-tuesday-feburary-28th-at-630-pm/"&gt;CQRS at the Jacksonville Architecture Group on Tuesday (2/28) at 6pm&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/britchie/cqrs.png"&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/britchie/Media/cqrs.png" border="0"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Come out, get some pizza, and enjoy some CQRS.&lt;/p&gt;&lt;p&gt;Hope to see you &lt;a href="http://jaxarcsig.wordpress.com/2012/02/02/jacksonville-software-architecture-sig-february-meeting-tuesday-feburary-28th-at-630-pm/" target="_blank" mce_href="http://jaxarcsig.wordpress.com/2012/02/02/jacksonville-software-architecture-sig-february-meeting-tuesday-feburary-28th-at-630-pm/"&gt;there&lt;/a&gt;! &lt;/p&gt;&lt;p&gt;UPDATE: &lt;a href="http://www.slideshare.net/brianritchie1/cqrs-command-query-responsibility-segregation" target="_blank" mce_href="http://www.slideshare.net/brianritchie1/cqrs-command-query-responsibility-segregation"&gt;Slides posted on SlideShare&lt;/a&gt;. &lt;br&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description><pubDate>Mon, 27 Feb 2012 13:57:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/come-out-for-a-cqrs-presentation-at-the-jax-architecture-group</guid><category>.NET</category><category>Architecture</category><category>CQRS</category><category>General Software Development</category></item><item><title>Hosting Windows Services in IIS Presentation at JAXDUG</title><link>https://weblogs.asp.net:443/britchie/hosting-windows-services-in-iis-presentation-at-jaxdug</link><description>&lt;p&gt;Thanks to everyone who came out for my presentation at the Jacksonville Developer User Group tonight.&amp;nbsp; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Here are the slides on &lt;a href="http://www.slideshare.net/brianritchie1/iis-alwayson-services" target="_blank" mce_href="http://www.slideshare.net/brianritchie1/iis-alwayson-services"&gt;SlideShare&lt;/a&gt;.&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Download the code for building your own service with self-hosted monitoring from &lt;a href="https://bitbucket.org/brianritchie/iisservicehost"&gt;BitBucket&lt;/a&gt;. &lt;br&gt;&lt;/li&gt;&lt;li&gt;You can also read my earlier blog post &lt;a href="/britchie/archive/2010/09/08/death-to-windows-services-long-live-appfabric.aspx" mce_href="/britchie/archive/2010/09/08/death-to-windows-services-long-live-appfabric.aspx"&gt;Death to Windows Services...Long Live IIS&lt;/a&gt;.&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/britchie/Media/IIS%2520Always-On%2520Services.png" mce_src="https://aspblogs.blob.core.windows.net/media/britchie/Media/IIS%2520Always-On%2520Services.png" height="302" width="402"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description><pubDate>Thu, 06 Oct 2011 01:53:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/hosting-windows-services-in-iis-presentation-at-jaxdug</guid><category>.NET</category><category>Always On</category><category>C#</category><category>IIS</category><category>Windows Services</category></item><item><title>Migrating from ASPX MVC views to Razor</title><link>https://weblogs.asp.net:443/britchie/migrating-from-aspx-mvc-views-to-razor</link><description>&lt;p&gt;&amp;nbsp;&lt;a href="/scottgu/archive/2010/07/02/introducing-razor.aspx" target="_blank" mce_href="/scottgu/archive/2010/07/02/introducing-razor.aspx"&gt;Razor-based view templates&lt;/a&gt; are a much cleaner way to construct MVC views in ASP.NET.&amp;nbsp; However, they were only released fairly recently with &lt;a href="http://www.asp.net/mvc/mvc3" target="_blank" mce_href="http://www.asp.net/mvc/mvc3"&gt;MVC3&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&amp;nbsp;If you still have some ASPX-based templates that you'd like to upgrade, &lt;a href="http://www.telerik.com/" target="_blank" mce_href="http://www.telerik.com/"&gt;Telerik&lt;/a&gt; has released a &lt;a href="https://github.com/telerik/razor-converter" target="_blank" mce_href="https://github.com/telerik/razor-converter"&gt;free tool&lt;/a&gt; to do just that. &lt;br&gt;&lt;/p&gt;</description><pubDate>Sat, 03 Sep 2011 13:36:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/migrating-from-aspx-mvc-views-to-razor</guid><category>ASP.NET</category><category>MVC</category><category>Razor</category></item><item><title>Web-based Farm Monitor for your Web Farm Framework Deployment</title><link>https://weblogs.asp.net:443/britchie/web-based-farm-monitor-for-your-web-farm-framework-deployment</link><description>
&lt;p&gt;&amp;nbsp;In my &lt;a href="/britchie/archive/tags/WFF/default.aspx" mce_href="/britchie/archive/tags/WFF/default.aspx"&gt;recent posts&lt;/a&gt; on scalability, I've mentioned the &lt;a href="http://www.iis.net/download/WebFarmFramework" mce_href="http://www.iis.net/download/WebFarmFramework"&gt;Web Farm Framework&lt;/a&gt; (WFF) as a solution for managing a farm of IIS servers.&amp;nbsp; It adds a nice management Server Farm management UI into the IIS Manager.&lt;/p&gt;

&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/britchie/Media/web-farm-framework-iis-mgr.png" mce_src="https://aspblogs.blob.core.windows.net/media/britchie/Media/web-farm-framework-iis-mgr.png" height="304" width="577"&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;It is a nice tool, but is only accessible via the windows interface. To make the farm more accessible, I've created a basic farm monitor MVC web site using the &lt;a href="http://learn.iis.net/page.aspx/925/web-farm-framework-20-for-iis-7-code-sample/" target="_blank" mce_href="http://learn.iis.net/page.aspx/925/web-farm-framework-20-for-iis-7-code-sample/"&gt;WFF .NET API&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&amp;nbsp;Here are a couple of screen shots of it in action: &lt;br&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;img src="https://aspblogs.blob.core.windows.net/media/britchie/Media/web-farm-monitor.png" mce_src="https://aspblogs.blob.core.windows.net/media/britchie/Media/web-farm-monitor.png" height="495" width="697"&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;It uses a few cool features of the API:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Getting a list of nodes in the farm &amp;amp; their status&lt;br&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;pre class="csharpcode"&gt;Microsoft.Web.Farm.WebFarmManager manager = &lt;span class="kwrd"&gt;new&lt;/span&gt; Microsoft.Web.Farm.WebFarmManager();            
&lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var farm &lt;span class="kwrd"&gt;in&lt;/span&gt; manager.WebFarms)
{
    &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var node &lt;span class="kwrd"&gt;in&lt;/span&gt; farm.Servers)
    {
    }
}&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;CPU/Memory monitoring.&amp;nbsp; See my &lt;a href="/britchie/archive/2011/08/30/adding-sparklines-to-your-mvc-site-using-the-net-chart-api.aspx" mce_href="/britchie/archive/2011/08/30/adding-sparklines-to-your-mvc-site-using-the-net-chart-api.aspx"&gt;sparkline post&lt;/a&gt; to learn how to create these kinds of infographics. &lt;br&gt;&lt;span id="ctl00_ContentPlaceHolder1_output"&gt;
&lt;pre class="csharpcode"&gt;PercentageCPU = node.Counters.ProcessorTime/100;
MemoryAvailableKBytes = node.Counters.MemoryAvailableKBytes;
PercentageMemoryAvailable = 1.0f - node.Counters.PercentageMemoryAvailable&lt;/pre&gt;&lt;/span&gt;
&lt;/li&gt;

&lt;li&gt;Getting a list of running processes &lt;br&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; ServerProcess[] GetNodeProcesses(&lt;span class="kwrd"&gt;string&lt;/span&gt; farmName, &lt;span class="kwrd"&gt;string&lt;/span&gt; nodeName)
{
    var manager = &lt;span class="kwrd"&gt;new&lt;/span&gt; Microsoft.Web.Farm.WebFarmManager();
    var farm = manager.WebFarms[farmName];
    var server = farm.Servers[nodeName];
    var processes = server.RunOperation(farm.CreateRunOperationOptions(&lt;span class="str"&gt;"GetProcesses"&lt;/span&gt;)) &lt;span class="kwrd"&gt;as&lt;/span&gt; ServerProcess[];
    &lt;span class="kwrd"&gt;return&lt;/span&gt; processes;
}&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
Download the &lt;a href="https://aspblogs.blob.core.windows.net/media/britchie/Media/WebFarmMonitor.zip" mce_href="https://aspblogs.blob.core.windows.net/media/britchie/Media/WebFarmMonitor.zip"&gt;source for the project&lt;/a&gt; if you'd like to take it for a spin.&amp;nbsp; Make sure the web site's application pool has enough permissions to access the web farm.&lt;br&gt;
&lt;br&gt;
</description><pubDate>Fri, 02 Sep 2011 00:41:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/web-based-farm-monitor-for-your-web-farm-framework-deployment</guid><category>ASP.NET</category><category>C#</category><category>MVC</category><category>WFF</category></item><item><title>Using the .NET Chart API to add sparklines to your MVC site</title><link>https://weblogs.asp.net:443/britchie/adding-sparklines-to-your-mvc-site-using-the-net-chart-api</link><description>&lt;p&gt;In my &lt;a href="/britchie/archive/2011/08/27/sparkline-helper-method-for-your-mvc-site.aspx" mce_href="/britchie/archive/2011/08/27/sparkline-helper-method-for-your-mvc-site.aspx"&gt;last post&lt;/a&gt;, I introduced &lt;a href="/britchie/archive/2011/08/27/sparkline-helper-method-for-your-mvc-site.aspx" mce_href="/britchie/archive/2011/08/27/sparkline-helper-method-for-your-mvc-site.aspx"&gt;sparklines&lt;/a&gt; and showed you how to generate them using the &lt;a href="http://code.google.com/apis/chart/" target="_blank" mce_href="http://code.google.com/apis/chart/"&gt;Google Chart API&lt;/a&gt;.&amp;nbsp; Using an external API may not be appropriate for all applications, so here is a way to generate the sparkline using the .NET Chart API.&lt;/p&gt;

&lt;p&gt;Over at the &lt;a href="http://betterdashboards.wordpress.com/" target="_blank" mce_href="http://betterdashboards.wordpress.com/"&gt;Better Dashboards Blog&lt;/a&gt;, they provide some &lt;a href="http://betterdashboards.wordpress.com/2010/02/21/how-to-create-a-sparkline-chart-in-asp-net/" target="_blank" mce_href="http://betterdashboards.wordpress.com/2010/02/21/how-to-create-a-sparkline-chart-in-asp-net/"&gt;sample code&lt;/a&gt; for calling the chart API.&amp;nbsp; The following shows how to make it reusable for your MVC application.&lt;/p&gt;

&lt;p&gt;First, we'll create a custom ActionResult to return the image for our sparkline:&lt;/p&gt;

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; SparklineResult : FileResult
    {
        IEnumerable&amp;lt;&lt;span class="kwrd"&gt;float&lt;/span&gt;&amp;gt; samples;
        &lt;span class="kwrd"&gt;int&lt;/span&gt; SparklineWidth;
        &lt;span class="kwrd"&gt;int&lt;/span&gt; SparklineHeight;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; SparklineResult(&lt;span class="kwrd"&gt;int&lt;/span&gt; width, &lt;span class="kwrd"&gt;int&lt;/span&gt; height, IEnumerable&amp;lt;&lt;span class="kwrd"&gt;float&lt;/span&gt;&amp;gt; samples) : &lt;span class="kwrd"&gt;base&lt;/span&gt;(&lt;span class="str"&gt;"image/png"&lt;/span&gt;)
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.samples = samples;
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.SparklineHeight = height;
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.SparklineWidth = width;
        }
        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; WriteFile(HttpResponseBase response)
        {
            var sparklineImage = GetSparkLineImage(samples, SparklineWidth, SparklineHeight);
            response.ContentType = &lt;span class="str"&gt;"image/png"&lt;/span&gt;;
            response.BinaryWrite(sparklineImage);
        }
        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] GetSparkLineImage(IEnumerable&amp;lt;&lt;span class="kwrd"&gt;float&lt;/span&gt;&amp;gt; samples, &lt;span class="kwrd"&gt;int&lt;/span&gt; width, &lt;span class="kwrd"&gt;int&lt;/span&gt; height)
        {
            var chart = &lt;span class="kwrd"&gt;new&lt;/span&gt; Chart();
            var series = &lt;span class="kwrd"&gt;new&lt;/span&gt; Series();
            chart.Series.Add(series);
            &lt;span class="rem"&gt;// Sparklines use the 'Spline' chart type to show a smoother trend with a line chart&lt;/span&gt;
            series.ChartType = SeriesChartType.Spline;
            &lt;span class="rem"&gt;// Since the line is the only thing you see on the chart, you might want to&lt;/span&gt;
            &lt;span class="rem"&gt;// increase its width. Interestingly, you need to set the BorderWidth property&lt;/span&gt;
            &lt;span class="rem"&gt;// in order to accomplish that.&lt;/span&gt;
            series.BorderWidth = 2;
            &lt;span class="rem"&gt;// Add samples to the series&lt;/span&gt;
            &lt;span class="kwrd"&gt;int&lt;/span&gt; i = 0;
            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var sample &lt;span class="kwrd"&gt;in&lt;/span&gt; samples)
            {
                i++;
                &lt;span class="rem"&gt;// Add 5 to the sample so line does not get cut off at the bottom of the image&lt;/span&gt;
                chart.Series[0].Points.AddXY(DateTime.Now.AddDays(i), sample + 5);
            }
            &lt;span class="rem"&gt;// Start hiding both sets of axes, labels, gridlines and tick marks&lt;/span&gt;
            var chartArea = &lt;span class="kwrd"&gt;new&lt;/span&gt; ChartArea();
            chart.ChartAreas.Add(chartArea);
            chartArea.AxisX.LabelStyle.Enabled = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
            chartArea.AxisY.LabelStyle.Enabled = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
            chartArea.AxisX.MajorGrid.Enabled = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
            chartArea.AxisY.MajorGrid.Enabled = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
            chartArea.AxisX.MajorTickMark.Enabled = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
            chartArea.AxisY.MajorTickMark.Enabled = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
            chartArea.AxisX.LineWidth = 0;
            chartArea.AxisY.LineWidth = 0;
            chartArea.AxisY.Minimum = 0;
            &lt;span class="rem"&gt;// Add an extra 5 pixels since the samples were adjusted up by 5&lt;/span&gt;
            &lt;span class="rem"&gt;// this prevents the line from being truncated&lt;/span&gt;
            chartArea.AxisY.Maximum = 105;
            &lt;span class="rem"&gt;// Re-adjust the size of the chart to reduce unnecessary white space&lt;/span&gt;
            chart.Width = width;
            chart.Height = height;
            &lt;span class="rem"&gt;// Get bytes of PNG image&lt;/span&gt;
            var s = &lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream();
            chart.SaveImage(s, ChartImageFormat.Png);
            s.Position = 0;
            &lt;span class="kwrd"&gt;return&lt;/span&gt; s.ToArray();
        }
    }
&lt;/pre&gt;

&lt;p&gt;Next, we'll utilize the SparklineResult in a controller.  The controller will serve the image data for the sparkline back to the calling page.&lt;/p&gt;

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ChartController : Controller
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult Sparkline(&lt;span class="kwrd"&gt;int&lt;/span&gt; width, &lt;span class="kwrd"&gt;int&lt;/span&gt; height, &lt;span class="kwrd"&gt;string&lt;/span&gt; samples)
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; SparklineResult(width, height, (from s &lt;span class="kwrd"&gt;in&lt;/span&gt; samples.Split(&lt;span class="str"&gt;','&lt;/span&gt;) select &lt;span class="kwrd"&gt;float&lt;/span&gt;.Parse(s)).ToArray());
        }
    }&lt;/pre&gt;

&lt;p&gt;Next, we'll create a HTML helper method to generate the img tag which will fetch the image from our controller. &lt;br&gt;&lt;/p&gt;

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; MvcHtmlString DrawSparkline(&lt;span class="kwrd"&gt;this&lt;/span&gt; HtmlHelper helper, &lt;span class="kwrd"&gt;int&lt;/span&gt; width, &lt;span class="kwrd"&gt;int&lt;/span&gt; height, IEnumerable&amp;lt;&lt;span class="kwrd"&gt;int&lt;/span&gt;&amp;gt; plotData)
        {
            &lt;span class="kwrd"&gt;string&lt;/span&gt; sparkUrl = &lt;span class="str"&gt;"&amp;lt;img src='/chart/sparkline?width={0}&amp;amp;height={1}&amp;amp;samples={2}'/&amp;gt;"&lt;/span&gt;;
            &lt;span class="kwrd"&gt;string&lt;/span&gt; sparkLine = String.Format(sparkUrl, width, height, String.Join(&lt;span class="str"&gt;","&lt;/span&gt;, plotData));
            &lt;span class="kwrd"&gt;return&lt;/span&gt; MvcHtmlString.Create(sparkLine);
        }&lt;/pre&gt;

&lt;p&gt;Now we can call the helper method from our Razor template:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;       @Html.DrawSparkline(70, 20, &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt;[14] { 1, 4, 2, 6, 20, 30, 1, 23, 14, 2, 41, 2, 33, 21 })&lt;/pre&gt;


&lt;p&gt;Which produces the following sparkline:&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;img src="https://aspblogs.blob.core.windows.net/media/britchie/Media/sparkline.png"&gt;&lt;/p&gt;&lt;p&gt;You can download my &lt;a href="https://aspblogs.blob.core.windows.net/media/britchie/Media/MvcSparklines.zip" mce_href="https://aspblogs.blob.core.windows.net/media/britchie/Media/MvcSparklines.zip"&gt;sample project&lt;/a&gt; that puts it all together.&amp;nbsp; This includes both the Google API &amp;amp; .NET API methods.&lt;br&gt;&lt;/p&gt;

</description><pubDate>Wed, 31 Aug 2011 02:38:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/adding-sparklines-to-your-mvc-site-using-the-net-chart-api</guid><category>ASP.NET</category><category>C#</category><category>Charting</category><category>MVC</category><category>Sparkline</category></item><item><title>Adding sparklines to your MVC site using the Google Chart API</title><link>https://weblogs.asp.net:443/britchie/sparkline-helper-method-for-your-mvc-site</link><description>&lt;p&gt;Sparklines present trends and variations associated with some measurement in a very compact form.&amp;nbsp; The term &amp;amp; concept was proposed by &lt;a href="http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR" target="_blank" mce_href="http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR"&gt;Ed Tufte&lt;/a&gt;.&amp;nbsp; This form of information graphic has become very popular for dashboards.&amp;nbsp; In this post, I'll show how add sparklines to your site using a custom HTML Helper method to generate code accessing the Google Chart API. In my next post, I'll show you how to add sparklines using the .NET charting API.&lt;br&gt;&lt;/p&gt;&lt;p&gt;The folks over at Data Driven wrote a post about using the &lt;a href="http://www.datadrivenconsulting.com/2010/07/using-google-chart-api-to-create-dashboards-and-sparklines/" mce_href="http://www.datadrivenconsulting.com/2010/07/using-google-chart-api-to-create-dashboards-and-sparklines/"&gt;Google Chart API to render a sparkline&lt;/a&gt;.&amp;nbsp; The following shows how to take this concept &amp;amp; make it reusable by your MVC application.&lt;br&gt;&lt;/p&gt;&lt;p&gt;Code for the extension method:&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;/p&gt;&lt;pre class="csharpcode"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; MvcHtmlString DrawSparkline(&lt;span class="kwrd"&gt;this&lt;/span&gt; HtmlHelper helper, &lt;span class="kwrd"&gt;int&lt;/span&gt; width, &lt;span class="kwrd"&gt;int&lt;/span&gt; height, IEnumerable&amp;lt;&lt;span class="kwrd"&gt;int&lt;/span&gt;&amp;gt; plotData,
            &lt;span class="kwrd"&gt;string&lt;/span&gt; bgColor, &lt;span class="kwrd"&gt;string&lt;/span&gt; lineColor, &lt;span class="kwrd"&gt;string&lt;/span&gt; labelColor)
        {
            &lt;span class="kwrd"&gt;int&lt;/span&gt;? max = plotData.Max();
            &lt;span class="kwrd"&gt;int&lt;/span&gt;? min = plotData.Min();
            &lt;span class="kwrd"&gt;string&lt;/span&gt; list = String.Join(&lt;span class="str"&gt;","&lt;/span&gt;, plotData);
            &lt;span class="kwrd"&gt;string&lt;/span&gt; sparkUrl = &lt;span class="str"&gt;"&amp;lt;img src='http://chart.apis.google.com/"&lt;/span&gt; +
                 &lt;span class="str"&gt;"chart?cht=lc&amp;amp;chf=bg,s,{6}&amp;amp;cgh=0,50,1,0&amp;amp;chds={0},{1}&amp;amp;chs={2}x{3}&amp;amp;chd=t:{4}&amp;amp;chco={8}"&lt;/span&gt; +
                 &lt;span class="str"&gt;"&amp;amp;chls=1,1,0&amp;amp;chm=o,{7},0,20,4&amp;amp;chxt=r,x,y&amp;amp;chxs=0,{7},11,0,_|1,{7},1,0,_|2,{7},1,0,_&amp;amp;chxl=0:|{5}|1:||2:||'/&amp;gt;"&lt;/span&gt;;
            &lt;span class="kwrd"&gt;string&lt;/span&gt; sparkLine = String.Format(sparkUrl, min, max, width, height, list, plotData.Last(), bgColor, labelColor, lineColor);
            &lt;span class="kwrd"&gt;return&lt;/span&gt; MvcHtmlString.Create(sparkLine);
        }&lt;/pre&gt;

&lt;p&gt;And here is an example of calling the HTML helper from a MVC Razor template: &lt;br&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;code&gt;&lt;font size="2" color="black" face="Courier New"&gt;&lt;/font&gt;
&lt;font size="2" color="black" face="Courier New"&gt;
@Html.DrawSparkline(70, 20, &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;font color="#0000ff"&gt;int&lt;/font&gt;[14] { 1, 4, 2, 6, 20, 30, 1, 23, 14, 2, 41, 2, 33, 21 }, &lt;font color="#A31515"&gt;"ffffff"&lt;/font&gt;, &lt;font color="#A31515"&gt;"999999"&lt;/font&gt;, &lt;font color="#A31515"&gt;"990000"&lt;/font&gt;)
&lt;/font&gt;
&lt;/code&gt;&lt;/blockquote&gt;

&lt;p&gt;Which produces the following sparkline:&lt;br&gt;&lt;/p&gt;

&lt;img src="http://chart.apis.google.com/chart?cht=lc&amp;amp;chf=bg,s,ffffff&amp;amp;cgh=0,50,1,0&amp;amp;chds=1,41&amp;amp;chs=70x20&amp;amp;chd=t:1,4,2,6,20,30,1,23,14,2,41,2,33,21&amp;amp;chco=999999&amp;amp;chls=1,1,0&amp;amp;chm=o,990000,0,20,4&amp;amp;chxt=r,x,y&amp;amp;chxs=0,990000,11,0,_%7C1,990000,1,0,_%7C2,990000,1,0,_&amp;amp;chxl=0:%7C21%7C1:%7C%7C2:%7C%7C" mce_src="http://chart.apis.google.com/chart?cht=lc&amp;amp;chf=bg,s,ffffff&amp;amp;cgh=0,50,1,0&amp;amp;chds=1,41&amp;amp;chs=70x20&amp;amp;chd=t:1,4,2,6,20,30,1,23,14,2,41,2,33,21&amp;amp;chco=999999&amp;amp;chls=1,1,0&amp;amp;chm=o,990000,0,20,4&amp;amp;chxt=r,x,y&amp;amp;chxs=0,990000,11,0,_%7C1,990000,1,0,_%7C2,990000,1,0,_&amp;amp;chxl=0:%7C21%7C1:%7C%7C2:%7C%7C"&gt;</description><pubDate>Sun, 28 Aug 2011 03:37:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/sparkline-helper-method-for-your-mvc-site</guid><category>ASP.NET</category><category>C#</category><category>MVC</category><category>Sparkline</category></item><item><title>Scaling Out .NET Presentation at Jax Code Camp 2011</title><link>https://weblogs.asp.net:443/britchie/scaling-out-net-presentation-at-jax-code-camp-2011</link><description>
&lt;p&gt;Today at the &lt;a href="http://www.jaxcodecamp.com/" target="_blank" mce_href="http://www.jaxcodecamp.com/"&gt;Jax Code Camp&lt;/a&gt; I gave a presentation on scaling out your .NET applications by leveraging &lt;a href="http://www.iis.net/" mce_href="http://www.iis.net/"&gt;IIS7&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/windowsserver/ee695849" mce_href="http://msdn.microsoft.com/en-us/windowsserver/ee695849"&gt;AppFabric&lt;/a&gt;, &lt;a href="http://www.iis.net/download/WebFarmFramework" mce_href="http://www.iis.net/download/WebFarmFramework"&gt;Web Farm Framework&lt;/a&gt;, and &lt;a href="http://www.iis.net/download/WebDeploy" mce_href="http://www.iis.net/download/WebDeploy"&gt;Web Deploy&lt;/a&gt;.&amp;nbsp; Thanks to everyone how come out to the session.&lt;br&gt;&lt;/p&gt;

&lt;p&gt;I've posted the &lt;a href="http://www.slideshare.net/brianritchie1/scaling-out-net" mce_href="http://www.slideshare.net/brianritchie1/scaling-out-net"&gt;presentation&lt;/a&gt; over at SlideShare and here are some related blog posts that I mentioned during the talk:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="/britchie/archive/2010/10/26/configuring-appfabric-session-hosts-dynamically.aspx" target="_blank" mce_href="/britchie/archive/2010/10/26/configuring-appfabric-session-hosts-dynamically.aspx"&gt;Configuring AppFabric Cache Hosts Dynamically&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href="/britchie/archive/2010/09/08/death-to-windows-services-long-live-appfabric.aspx" mce_href="/britchie/archive/2010/09/08/death-to-windows-services-long-live-appfabric.aspx"&gt;Using AppFabric to host Windows Services&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href="/britchie/archive/2011/08/27/f5-add-on-for-web-farm-framework.aspx" mce_href="/britchie/archive/2011/08/27/f5-add-on-for-web-farm-framework.aspx"&gt;F5 add-on for Web Farm Framework&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="http://www.slideshare.net/brianritchie1/scaling-out-net" mce_href="http://www.slideshare.net/brianritchie1/scaling-out-net"&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/britchie/Media/ScalingOut.png" style="width: 402px; height: 302px;" title="Scaling Out .NET" alt="Scaling Out .NET" mce_src="https://aspblogs.blob.core.windows.net/media/britchie/Media/ScalingOut.png" border="0" height="302" hspace="4" vspace="4" width="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Need further reading? &lt;/p&gt;
&lt;div style="text-align: left; text-indent: -0.38in; margin-top: 4.32pt; margin-bottom: 0pt; margin-left: 0.38in;"&gt;&lt;span style="font-size: 14pt;"&gt;&lt;span style="font-family: Arial"&gt;» &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(103, 93, 89); font-family: Calibri; font-size: 14pt; g: 12.0pt; xtfill-fill-alpha: 100.0%;"&gt;Web
Farm Framework&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left; text-indent: -0.31in; margin-top: 2.64pt; margin-bottom: 0pt; margin-left: 0.81in;" class="O1"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Arial"&gt;˃&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;Web
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;Farm
Framework&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://www.iis.net/download/WebFarmFramework"&gt;http://&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://www.iis.net/download/WebFarmFramework"&gt;www.iis.net/download/WebFarmFramework&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left; text-indent: -0.31in; margin-top: 2.64pt; margin-bottom: 0pt; margin-left: 0.81in;" class="O1"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Arial"&gt;˃&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;Scott
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;Gu’s&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;
Introduce to WFF 2.0&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2010/09/08/introducing-the-microsoft-web-farm-framework.aspx"&gt;http://&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2010/09/08/introducing-the-microsoft-web-farm-framework.aspx"&gt;weblogs.asp.net/scottgu/archive/2010/09/08/introducing-the-microsoft-web-farm-framework.aspx&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left; text-indent: -0.31in; margin-top: 2.64pt; margin-bottom: 0pt; margin-left: 0.81in;" class="O1"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Arial"&gt;˃&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;WFF
Documentation (including API &amp;amp; &lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;Powershell&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;)&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://learn.iis.net/page.aspx/905/microsoft-web-farm-framework-20-for-iis-7/"&gt;http://learn.iis.net/page.aspx/905/microsoft-web-farm-framework-20-for-iis-7/&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://learn.iis.net/page.aspx/905/microsoft-web-farm-framework-20-for-iis-7/"&gt;/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left; text-indent: -0.38in; margin-top: 4.32pt; margin-bottom: 0pt; margin-left: 0.38in;"&gt;&lt;span style="font-size: 14pt;"&gt;&lt;span style="font-family: Arial"&gt;» &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(103, 93, 89); font-family: Calibri; font-size: 14pt; g: 12.0pt; xtfill-fill-alpha: 100.0%;"&gt;Windows AppFabric&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left; text-indent: -0.31in; margin-top: 2.64pt; margin-bottom: 0pt; margin-left: 0.81in;" class="O1"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Arial"&gt;˃&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;AppFabric
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;Architecture
Guide&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://blogs.msdn.com/b/yasserabdelkader/archive/2010/09/12/release-of-windows-server-appfabric-architecture-guide.aspx"&gt;http://&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://blogs.msdn.com/b/yasserabdelkader/archive/2010/09/12/release-of-windows-server-appfabric-architecture-guide.aspx"&gt;blogs.msdn.com/b/yasserabdelkader/archive/2010/09/12/release-of-windows-server-appfabric-architecture-guide.aspx&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left; text-indent: -0.31in; margin-top: 2.64pt; margin-bottom: 0pt; margin-left: 0.81in;" class="O1"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Arial"&gt;˃&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;AppFabric&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;
Management Pack for Op &lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;Mgr&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;
2007&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://blogs.technet.com/b/appfabric/archive/2010/06/14/appfabric-management-pack-available-for-operations-manager-2007.aspx"&gt;http://&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://blogs.technet.com/b/appfabric/archive/2010/06/14/appfabric-management-pack-available-for-operations-manager-2007.aspx"&gt;blogs.technet.com/b/appfabric/archive/2010/06/14/appfabric-management-pack-available-for-operations-manager-2007.aspx&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left; text-indent: -0.31in; margin-top: 2.64pt; margin-bottom: 0pt; margin-left: 0.81in;" class="O1"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Arial"&gt;˃&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;AppFabric&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;
Presentation&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://rstonkus.wordpress.com/2010/10/28/partner-conference-windows-server-appfabric/"&gt;http://rstonkus.wordpress.com/2010/10/28/partner-conference-windows-server-appfabric/&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://rstonkus.wordpress.com/2010/10/28/partner-conference-windows-server-appfabric/"&gt;/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left; text-indent: -0.38in; margin-top: 4.32pt; margin-bottom: 0pt; margin-left: 0.38in;"&gt;&lt;span style="font-size: 14pt;"&gt;&lt;span style="font-family: Arial"&gt;» &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(103, 93, 89); font-family: Calibri; font-size: 14pt; g: 12.0pt; xtfill-fill-alpha: 100.0%;"&gt;Other&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left; text-indent: -0.31in; margin-top: 2.64pt; margin-bottom: 0pt; margin-left: 0.81in;" class="O1"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Arial"&gt;˃&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;Memcached&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;
ASP.NET Providers&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://memcachedproviders.codeplex.com/"&gt;http://memcachedproviders.codeplex.com/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left; text-indent: -0.31in; margin-top: 2.64pt; margin-bottom: 0pt; margin-left: 0.81in;" class="O1"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Arial"&gt;˃&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;SQL
Table Queues&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://www.mssqltips.com/tip.asp?tip=1257"&gt;http://www.mssqltips.com/tip.asp?tip=1257&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left; text-indent: -0.31in; margin-top: 2.64pt; margin-bottom: 0pt; margin-left: 0.81in;" class="O1"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Arial"&gt;˃&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;Web
Deploy &lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;Team Blog&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://blogs.iis.net/msdeploy/default.aspx"&gt;http://&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://blogs.iis.net/msdeploy/default.aspx"&gt;blogs.iis.net/msdeploy/default.aspx&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left; text-indent: -0.31in; margin-top: 2.64pt; margin-bottom: 0pt; margin-left: 0.81in;" class="O1"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Arial"&gt;˃&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;Application
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;Request
Routing&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://www.iis.net/download/ApplicationRequestRouting"&gt;http://&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://www.iis.net/download/ApplicationRequestRouting"&gt;www.iis.net/download/ApplicationRequestRouting&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://learn.iis.net/page.aspx/486/http-load-balancing-using-application-request-routing/"&gt;http://learn.iis.net/page.aspx/486/http-load-balancing-using-application-request-routing/&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://learn.iis.net/page.aspx/486/http-load-balancing-using-application-request-routing/"&gt;/&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;br&gt;
&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://blogs.iis.net/mailant/archive/2010/03/25/how-iis-application-request-routing-arr-powers-elastic-scale-for-maximumasp.aspx"&gt;http://&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(77, 91, 107); font-family: Calibri; font-size: 11pt"&gt;&lt;a href="http://blogs.iis.net/mailant/archive/2010/03/25/how-iis-application-request-routing-arr-powers-elastic-scale-for-maximumasp.aspx"&gt;blogs.iis.net/mailant/archive/2010/03/25/how-iis-application-request-routing-arr-powers-elastic-scale-for-maximumasp.aspx&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;</description><pubDate>Sat, 27 Aug 2011 16:49:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/scaling-out-net-presentation-at-jax-code-camp-2011</guid><category>.NET</category><category>AppFabric</category><category>ASP.NET</category><category>IIS</category><category>Web Deploy</category><category>WFF</category></item><item><title>F5 Add-on for Web Farm Framework </title><link>https://weblogs.asp.net:443/britchie/f5-add-on-for-web-farm-framework</link><description>&lt;p&gt;Gupreet over on the IIS.NET site &lt;a href="http://blogs.iis.net/gursing/archive/2011/01/21/how-to-integrate-f5-with-web-farm-framework.aspx" target="_blank" mce_href="http://blogs.iis.net/gursing/archive/2011/01/21/how-to-integrate-f5-with-web-farm-framework.aspx"&gt;posted a sample&lt;/a&gt; for integrating an F5 load balancer with the Web Farm Framework.&amp;nbsp; It works well, but isn't configurable.&amp;nbsp; I started adding my own configuration, but artisticcheese posted a &lt;a href="http://f5wff.codeplex.com/" mce_href="http://f5wff.codeplex.com/"&gt;project to CodePlex&lt;/a&gt; that already has this functionality.&lt;/p&gt;&lt;p&gt;To install, download the extension and perform the following:&amp;nbsp;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Create&amp;nbsp;pool on F5 load balanacer with exactly the same 
name on WFF. Do not add any farm members yet. 
&lt;li&gt;Stop WFF service 
&lt;li&gt;Create folder "%programfiles%\IIS\Microsoft Web Farm Framework\extensions" 
and put all files in distribution into that folder 
&lt;li&gt;Modify "F5LoadBalancer.dll.config" file to point to active node of F5 
loadbalancer and authentication credentials 
&lt;li&gt;Copy "icontrol.dll" into "%programfiles%\IIS\Microsoft Web Farm Framework" 
&lt;li&gt;Open  "%systemroot%\system32\inetsrv\config\applicationHost.config" and edit 
XML node below by adding attribute in bold &amp;lt;webFarm name="DevWebFarm" 
enabled="true" primaryServer="webnode1" &lt;strong&gt;loadBalancerProvider="F5"&lt;/strong&gt;&amp;gt; 
&lt;li&gt;Start WFF service &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;a href="http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/2/Default.aspx" mce_href="http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/2/Default.aspx"&gt;iControl.dll&lt;/a&gt; is an assembly provided by BigIP giving you a .NET API to control your &lt;a href="http://www.f5.com/products/big-ip/local-traffic-manager.html" mce_href="http://www.f5.com/products/big-ip/local-traffic-manager.html"&gt;F5 Local Traffic Balancer&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Now that you have it installed, WFF will automatically take nodes online &amp;amp; offline thru the F5 as needed.&amp;nbsp; This supports rolling deployments and more.&lt;/p&gt;</description><pubDate>Sat, 27 Aug 2011 16:24:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/f5-add-on-for-web-farm-framework</guid><category>.NET</category><category>ASP.NET</category><category>F5</category><category>IIS</category><category>WFF</category></item><item><title>Internet Explorer 9 is coming Monday to a web near you</title><link>https://weblogs.asp.net:443/britchie/internet-explorer-9-is-coming-monday-to-a-web-near-you</link><description>&lt;P mce_keep="true"&gt;&lt;A class="" href="http://windows.microsoft.com/en-US/internet-explorer/products/ie-9/home" target=_blank mce_href="http://windows.microsoft.com/en-US/internet-explorer/products/ie-9/home"&gt;Internet Explorer 9&lt;/A&gt; is finally here...well almost.&amp;nbsp; Microsoft is releasing their new browser on March 14, 2011.&lt;/P&gt;
&lt;P mce_keep="true"&gt;IE9 has a number of improvements, including:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;Faster, Faster, Faster.&lt;/STRONG&gt;&amp;nbsp; Did I mention it is faster?&amp;nbsp;&amp;nbsp;&amp;nbsp;With the new browsers coming out from Mozilla, Google, and Microsoft, there have been a flood of speed test coverage.&amp;nbsp; Chrome has long held the javascript speed crown.&amp;nbsp; But according to &lt;A class="" href="http://www.zdnet.com/blog/networking/chrome-10-vs-internet-explorer-9-reconsidered/792" target=_blank mce_href="http://www.zdnet.com/blog/networking/chrome-10-vs-internet-explorer-9-reconsidered/792"&gt;Steven J. Vaughan-Nichols&lt;/A&gt; over at ZDNET..."for the moment at least IE9 is actually the &lt;A class="" href="http://i.zdnet.com/blogs/sunspider-web-browser-results-march-10-2011.gif?tag=mantle_skin;content" target=_blank mce_href="http://i.zdnet.com/blogs/sunspider-web-browser-results-march-10-2011.gif?tag=mantle_skin;content"&gt;fastest browser&lt;/A&gt; I’ve tested to date."&amp;nbsp; He came to this revelation after figuring out that the 32-bit version of IE9 has the new &lt;A class="" href="http://blogs.msdn.com/b/ie/archive/2010/03/18/the-new-javascript-engine-in-internet-explorer-9.aspx" target=_blank mce_href="http://blogs.msdn.com/b/ie/archive/2010/03/18/the-new-javascript-engine-in-internet-explorer-9.aspx"&gt;Chakra JIT&lt;/A&gt;&amp;nbsp;(the 64-bit version doesn't).&amp;nbsp; It also has a DirectX-based rendering engine so it can do &lt;A class="" href="http://ie.microsoft.com/testdrive/" target=_blank mce_href="http://ie.microsoft.com/testdrive/"&gt;cool tricks&lt;/A&gt; once reserved for desktop applications.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;Windows 7 Desktop Integration.&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;Read&amp;nbsp;&lt;A class="" href="http://weblogs.asp.net/britchie/archive/2010/11/02/internet-explorer-9-adds-innovative-desktop-integration.aspx" target=_blank mce_href="/britchie/archive/2010/11/02/internet-explorer-9-adds-innovative-desktop-integration.aspx"&gt;my post&lt;/A&gt;&amp;nbsp;for more details.&amp;nbsp; Unfortantely, they didn't integrate &lt;A class="" href="http://weblogs.asp.net/britchie/archive/2010/11/04/thoughts-on-improving-ie9-integration-features.aspx" target=_blank mce_href="/britchie/archive/2010/11/04/thoughts-on-improving-ie9-integration-features.aspx"&gt;my ideas&lt;/A&gt;...at least not yet :)&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;Hot new UI&lt;/STRONG&gt;.&amp;nbsp; Ok, they "borrowed" some ideas from Chrome...but that is the best form of flattery.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;Standards Compliance.&lt;/STRONG&gt;&amp;nbsp; A real focus on HTML5 and CSS3.&amp;nbsp; Definite goodness for developers.&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;So, go get yourself some IE9 on Monday and enjoy!&amp;nbsp; &lt;/P&gt;</description><pubDate>Fri, 11 Mar 2011 00:01:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/internet-explorer-9-is-coming-monday-to-a-web-near-you</guid><category>Browsers</category><category>General Software Development</category><category>IE9</category></item><item><title>Microsoft releases Visual Studio 2010 SP1</title><link>https://weblogs.asp.net:443/britchie/microsoft-releases-visual-studio-2010-sp1</link><description>&lt;p&gt;Microsoft has been beta testing SP1 since December of last year.&amp;nbsp; Today, it was &lt;a href="http://visualstudiomagazine.com/articles/2011/03/08/vs2010-sp1.aspx" target="_blank" mce_href="http://visualstudiomagazine.com/articles/2011/03/08/vs2010-sp1.aspx"&gt;released&lt;/a&gt; to &lt;a href="http://go.microsoft.com/fwlink/?LinkId=207267" target="_blank" mce_href="http://go.microsoft.com/fwlink/?LinkId=207267"&gt;MSDN subscribers&lt;/a&gt; and will be available for &lt;a href="http://go.microsoft.com/fwlink/?LinkId=209902" target="_blank" mce_href="http://go.microsoft.com/fwlink/?LinkId=209902"&gt;public download&lt;/a&gt; on March 10, 2011.&lt;/p&gt;&lt;p&gt;The service pack includes a &lt;a href="http://support.microsoft.com/kb/983509" target="_blank" mce_href="http://support.microsoft.com/kb/983509"&gt;slew of fixes&lt;/a&gt;, and a number of new features: &lt;br&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.silverlight.net/getstarted/silverlight-4/" target="_blank" mce_href="http://www.silverlight.net/getstarted/silverlight-4/"&gt;Silverlight 4&lt;/a&gt; support&lt;/li&gt;&lt;li&gt;Basic Unit Testing support for the .NET Framework 3.5&lt;/li&gt;&lt;li&gt;Performance Wizard for Silverlight&lt;/li&gt;&lt;li&gt;IntelliTrace for 64-bit and SharePoint&lt;/li&gt;&lt;li&gt;&lt;a href="/scottgu/archive/2010/06/28/introducing-iis-express.aspx" target="_blank" mce_href="/scottgu/archive/2010/06/28/introducing-iis-express.aspx"&gt;IIS Express&lt;/a&gt; support&lt;/li&gt;&lt;li&gt;&lt;a href="/scottgu/archive/2010/06/30/new-embedded-database-support-with-asp-net.aspx" target="_blank" mce_href="/scottgu/archive/2010/06/30/new-embedded-database-support-with-asp-net.aspx"&gt;SQL CE 4&lt;/a&gt; support&lt;/li&gt;&lt;li&gt;&lt;a href="/scottgu/archive/2010/07/02/introducing-razor.aspx" target="_blank" mce_href="/scottgu/archive/2010/07/02/introducing-razor.aspx"&gt;Razor&lt;/a&gt; support&lt;/li&gt;&lt;li&gt;HTML5 and CSS3 support (IntelliSense and validation)&lt;/li&gt;&lt;li&gt;WCF RIA Services V1 SP1 included&lt;/li&gt;&lt;li&gt;Visual Basic Runtime embedding&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb385832.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/bb385832.aspx"&gt;ALM Improvements&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Of all the improvements, IIS Express probably has the largest impact on web developer productivity.&amp;nbsp; &lt;/p&gt;&lt;p&gt;According to &lt;a href="/scottgu/default.aspx" target="_blank" mce_href="/scottgu/default.aspx"&gt;Scott Gu&lt;/a&gt;, it provides the following:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It’s lightweight and easy to install (less than 10Mb download and a super quick install)&lt;/li&gt;&lt;li&gt;It &lt;u&gt;does not&lt;/u&gt; require an administrator account to run/debug applications from Visual Studio &lt;/li&gt;&lt;li&gt;It enables a &lt;u&gt;full web-server feature set&lt;/u&gt; – including SSL, URL Rewrite, Media Support, and all other IIS 7.x modules &lt;/li&gt;&lt;li&gt;It supports and enables the same extensibility model and web.config file settings that IIS 7.x support &lt;/li&gt;&lt;li&gt;It
 can be installed side-by-side with the full IIS web server as well as 
the ASP.NET Development Server (they do not conflict at all) &lt;/li&gt;&lt;li&gt;It works on Windows XP and higher operating systems – giving you a full IIS 7.x developer feature-set on all OS platforms &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;font size="2"&gt;    &lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;IIS Express (like the ASP.NET Development Server) can be quickly launched to run a site from a directory on disk.&amp;nbsp; It &lt;u&gt;does not&lt;/u&gt; require any registration/configuration steps. This makes it really easy to launch and run for development scenarios.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;Good stuff indeed.&amp;nbsp; This will make our lives much easier.&amp;nbsp; Thanks Microsoft...we're feeling the love!&lt;br&gt;&lt;/font&gt;&lt;/p&gt; &lt;br&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description><pubDate>Wed, 09 Mar 2011 02:50:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/microsoft-releases-visual-studio-2010-sp1</guid><category>IIS</category><category>Razor</category><category>Visual Studio</category><category>VS2010</category></item><item><title>Retrieving recent tweets using LINQ</title><link>https://weblogs.asp.net:443/britchie/retreiving-recent-tweets-using-linq</link><description>&lt;p&gt;There are a few different APIs for accessing &lt;a href="http://twitter.com/" mce_href="http://twitter.com/"&gt;Twitter&lt;/a&gt; from .NET.&amp;nbsp; In this example, I'll use &lt;a href="http://linqtotwitter.codeplex.com/" mce_href="http://linqtotwitter.codeplex.com/"&gt;linq2twitter&lt;/a&gt;.&amp;nbsp; Other APIs can be found on Twitter's &lt;a href="http://dev.twitter.com/pages/libraries#dotnet" mce_href="http://dev.twitter.com/pages/libraries#dotnet"&gt;development site&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;First off, we'll use the &lt;a href="http://msdn.microsoft.com/en-us/netframework/aa904594" mce_href="http://msdn.microsoft.com/en-us/netframework/aa904594"&gt;LINQ&lt;/a&gt; provider to pull in the recent tweets.&lt;br&gt;&lt;/p&gt;

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Status[] GetLatestTweets(&lt;span class="kwrd"&gt;string&lt;/span&gt; screenName, &lt;span class="kwrd"&gt;int&lt;/span&gt; numTweets)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        var twitterCtx = &lt;span class="kwrd"&gt;new&lt;/span&gt; LinqToTwitter.TwitterContext();&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        var list = from tweet &lt;span class="kwrd"&gt;in&lt;/span&gt; twitterCtx.Status&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;where&lt;/span&gt; tweet.Type == StatusType.User &amp;amp;&amp;amp; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;                               tweet.ScreenName == screenName&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;                    orderby tweet.CreatedAt descending&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;                    select tweet;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        &lt;span class="rem"&gt;// using Take() on array because it was failing against the provider&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        var recentTweets = list.ToArray().Take(numTweets).ToArray(); &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; recentTweets;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    &lt;span class="kwrd"&gt;catch&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Status[0];&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Once they have been retrieved, they would be placed inside an MVC model.&lt;/p&gt;
&lt;p&gt;Next, the tweets need to be formatted for display. I've defined an extension method to aid with date formatting:&lt;br&gt;&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; DateTimeExtension&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; ToAgo(&lt;span class="kwrd"&gt;this&lt;/span&gt; DateTime date2)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        DateTime date1 = DateTime.Now;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (DateTime.Compare(date1, date2) &amp;gt;= 0)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;            TimeSpan ts = date1.Subtract(date2);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (ts.TotalDays &amp;gt;= 1)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;"{0} days"&lt;/span&gt;, (&lt;span class="kwrd"&gt;int&lt;/span&gt;)ts.TotalDays);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (ts.Hours &amp;gt; 2)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;"{0} hours"&lt;/span&gt;, ts.Hours);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (ts.Hours &amp;gt; 0)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;"{0} hours, {1} minutes"&lt;/span&gt;, &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;                       ts.Hours, ts.Minutes);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (ts.Minutes &amp;gt; 5)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;"{0} minutes"&lt;/span&gt;, ts.Minutes);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (ts.Minutes &amp;gt; 0)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;"{0} mintutes, {1} seconds"&lt;/span&gt;, &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;                       ts.Minutes, ts.Seconds);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;"{0} seconds"&lt;/span&gt;, ts.Seconds);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;        }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="str"&gt;"Not valid"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;&lt;br&gt;Finally, here is the piece of the view used to render the tweets.&lt;br&gt;&lt;br&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="tweets"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var tweet &lt;span class="kwrd"&gt;in&lt;/span&gt; Model.Tweets)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt; &lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;     &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="tweets"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;     &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="tweetTime"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt;=tweet.CreatedAt.ToAgo() &lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt; ago&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;:&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        &lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt;=tweet.Text&lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt; &lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt;} &lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
</description><pubDate>Sun, 06 Mar 2011 01:50:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/britchie/retreiving-recent-tweets-using-linq</guid><category>C#</category><category>Extension Methods</category><category>LINQ</category></item></channel></rss>