<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Thinq Linq</title>
    <link>http://www.ThinqLinq.com/default.aspx</link>
    <description>Thoughts relating to LINQ and Language Integrated Query related topics.</description>
    <dc:language>en-US</dc:language>
    <generator>LINQ</generator>
    <geo:lat>33.99605</geo:lat><geo:long>-84.474649</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/thinqlinq/rss" type="application/rss+xml" /><feedburner:emailServiceId>thinqlinq/rss</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Adding Property Get logging to LINQ to SQL with T4</title>
      <link>http://feedproxy.google.com/~r/thinqlinq/rss/~3/tyoRf3nFzRU/Adding-Property-Get-logging-to-LINQ-to-SQL-with-T4.aspx</link>
      <pubDate>Thu, 16 Jul 2009 16:51:00 GMT</pubDate>
      <guid isPermaLink="false">42f563c8-34ea-4d01-bfe1-2047c2222a74:22072</guid>
      <dc:creator>jwooley</dc:creator>
      <slash:comments>0</slash:comments>
      <comments>http://www.thinqlinq.com/Default/Adding-Property-Get-logging-to-LINQ-to-SQL-with-T4.aspx</comments>
      <wfw:commentRss>http://www.thinqlinq.com/CommentRss.aspx?PostId=22072</wfw:commentRss>
      <wfw:comment>http://www.thinqlinq.com/Default/Adding-Property-Get-logging-to-LINQ-to-SQL-with-T4.aspx</wfw:comment>
      <description>&lt;p&gt;After my last &lt;a href="http://sarasota.sqlpass.org"&gt;INETA talk in Sarasota&lt;/a&gt;,&amp;nbsp; I had two separate people ask me how to enable auditing of LINQ to SQL when properties are read. Currently the classes created by the LINQ to SQL designer and SqlMetal add events to track before and after an individual property are changed through the INotifyPropertyChanged and INotifyPropertyChanging interfaces, but they don't include hooks to detect when a property is read.&lt;/p&gt; &lt;p&gt;One option to add read notification is to replace the default code generator with &lt;a href="http://www.codeplex.com/l2st4"&gt;L2ST4&lt;/a&gt; templates and to modify the template to include the necessary events on the property Gets. So how do we do this? &lt;/p&gt; &lt;p&gt;I'll leave it up to you to download, install and configure the templates to work on your dbml file using the instructions on the &lt;a href="http://www.codeplex.com/l2st4"&gt;L2ST4 CodePlex site&lt;/a&gt;. I'll focus here instead on how to extend them after they are already working. You can &lt;a href="http://www.ThinqLinq.com/Downloads/T4ReadNotification.zip"&gt;download the sample T4 implementation&lt;/a&gt; if you want to follow along. Since this is a VB project, I'll be modifying the VBNetDataClasses.tt file here, but the same process could be done with the CSharpDataClasses as well.&lt;/p&gt; &lt;p&gt;First, we need a way to identify if we are adding the read tracking. At the top of the file, we will add a property to the anonymous type setting the options that will be used in the code generation process. Here, we'll add a flag called IncludeReadTracking:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt;var options = new {
    DbmlFileName = Host.TemplateFile.Replace(".tt",".dbml"), // Which DBML file to operate on (same filename as template)
    SerializeDataContractSP1 = false, // Emit SP1 DataContract serializer attributes
    FilePerEntity = true, // Put each class into a separate file
    StoredProcedureConcurrency = false, // Table updates via an SP require @@rowcount to be returned to enable concurrency    
    EntityFilePath = Path.GetDirectoryName(Host.TemplateFile), // Where to put the files    
    &lt;strong&gt;IncludeReadTracking = true // Include audit read tracking ability&lt;/strong&gt;
};&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;The code generation is a mixture of C# templating code and VB generated code. The processing in the template is done in C# which is why, although we are modifying the VB template, this anonymous type is declared in C#.&lt;/p&gt;
&lt;p&gt;Next, we'll add a common delegate, args and interface that each of the classes will consume. This will mimic the implementation of INotifyPropertyChanging and INotifyPropertyChanged in the underlying .Net Framework. We'll call our interface INotifyPropertyRead which will expose a single PropertyRead event. Here is the code that we want to produce once we're done:&lt;/p&gt;&lt;pre&gt;&lt;code source="vbasic"&gt;
Public Interface INotifyPropertyRead
    Event PropertyRead As PropertyReadEventHandler
End Interface
Public Delegate Sub PropertyReadEventHandler(ByVal sender As Object, ByVal e as PropertyReadEventArgs)
Public Class PropertyReadEventArgs
    Inherits EventArgs
    Public Sub New(ByVal propertyName as String)
        _propertyName = propertyName
    End Sub
    Private ReadOnly _propertyName As String
    Public ReadOnly Property PropertyName As String
        Get
            Return _propertyName
        End Get
    End Property
End Class &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We could create this separately, in our project, however in this case, I'll go ahead and add id dynamically in the code generation process depending on if the flag is set. We do need to be careful when adding it because we only want it added once rather than copied for each table, and outside of the context's namespace. If you have multiple dbml and template files, you will need to move this to a more centralized location in your project. We'll do this right after the header is generated and before the namespace is specified. Locate the following lines near the top of the original T4 template:&lt;/p&gt;
&lt;p&gt;&amp;lt;#manager.EndHeader();&lt;br&gt;if (!String.IsNullOrEmpty(data.ContextNamespace)) {#&amp;gt;
&lt;p&gt;Replace them with&amp;nbsp; the following:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="background: gold"&gt;&amp;lt;#&lt;/span&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt; manager.EndHeader(); &lt;/span&gt;&lt;span style="background: gold"&gt;#&amp;gt;
&amp;lt;#&lt;/span&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt;if (options.IncludeReadTracking) {&lt;/span&gt;&lt;span style="background: gold"&gt;#&amp;gt;
&lt;/span&gt;&lt;span style="color: gray"&gt;Public Interface INotifyPropertyRead
    Event PropertyRead As PropertyReadEventHandler
End Interface
Public Delegate Sub PropertyReadEventHandler(ByVal sender As Object, ByVal e as PropertyReadEventArgs)
Public Class PropertyReadEventArgs
    Inherits EventArgs
    Public Sub New(ByVal propertyName as String)
        _propertyName = propertyName
    End Sub
    Private ReadOnly _propertyName As String
    Public ReadOnly Property PropertyName As String
        Get
            Return _propertyName
        End Get
    End Property
End Class 
&lt;/span&gt;&lt;span style="background: gold"&gt;&amp;lt;#&lt;/span&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt; } &lt;/span&gt;&lt;span style="background: gold"&gt;#&amp;gt;&lt;/span&gt;&lt;span style="color: red"&gt; 
&lt;/span&gt;&lt;span style="background: gold"&gt;&amp;lt;#&lt;/span&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt;if (!String.IsNullOrEmpty(data.ContextNamespace)) {&lt;/span&gt;&lt;span style="background: gold"&gt;#&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;If you're not familiar with T4, the &amp;lt;# and #&amp;gt; are similar to ASP or MVC's &amp;lt;% %&amp;gt;. Code that is entered inside of the place holders is evaluated and code that is outside of them is considered a string literal. In this case, we have an If block that checks the IncludeReadTracking flag we setup in the options earlier. If the flag is set, then the VB code will be output as the generation process is executed.&lt;/p&gt;
&lt;p&gt;Next, we need to modify the class definition corresponding to each table that is being read. The default implementation includes the definition for implements INotifyPropertyChanging, INotifyPropertyChanged. We'll add a designation (if the IncludeReadTracking is set) to also implement our new INotifyPropertyRead as follows:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: gray"&gt;Implements INotifyPropertyChanging, INotifyPropertyChanged&lt;/span&gt;&lt;span style="background: gold"&gt;&amp;lt;#&lt;/span&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt; if (options.IncludeReadTracking){ &lt;/span&gt;&lt;span style="background: gold"&gt;#&amp;gt;&lt;/span&gt;&lt;span style="color: red"&gt; &lt;/span&gt;&lt;span style="color: gray"&gt;, INotifyPropertyRead &lt;/span&gt;&lt;span style="background: gold"&gt;&amp;lt;#&lt;/span&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt; } &lt;/span&gt;&lt;span style="background: gold"&gt;#&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Next, we need to add the actual implementation. This is relatively simple as well. In the #Region for the Property Change Event Handling, add the following:&lt;/p&gt;&lt;pre class="code"&gt;        &lt;span style="background: gold"&gt;&amp;lt;#&lt;/span&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt; if (options.IncludeReadTracking){ &lt;/span&gt;&lt;span style="background: gold"&gt;#&amp;gt;
&lt;/span&gt;&lt;span style="color: red"&gt;        &lt;/span&gt;&lt;span style="color: gray"&gt;Public Event PropertyRead As PropertyReadEventHandler Implements INotifyPropertyRead.PropertyRead
        &lt;/span&gt;&lt;span style="background: gold"&gt;&amp;lt;#=&lt;/span&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt;code.Format(class1.PropertyChangeAccess)&lt;/span&gt;&lt;span style="background: gold"&gt;#&amp;gt;&lt;/span&gt;&lt;span style="color: gray"&gt;Sub OnPropertyRead(ByVal propertyName As String)
            RaiseEvent PropertyRead(Me, New PropertyReadEventArgs(propertyName))
        End Sub
        
        &lt;/span&gt;&lt;span style="background: gold"&gt;&amp;lt;#&lt;/span&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt; } &lt;/span&gt;&lt;span style="background: gold"&gt;#&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Notice here, we will only add this if the flag is set. Also, we check to see if we can override the functionality of OnPropertyRead by checking the class1.PropertyChangeAccess flag. &lt;/p&gt;
&lt;p&gt;The last change we make to the template is to modify the code generated for each Property Get which now reads as follows:&lt;/p&gt;&lt;pre class="code"&gt;            &lt;span style="color: gray"&gt;Get
&lt;/span&gt;&lt;span style="background: gold"&gt;&amp;lt;#&lt;/span&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt;                if (options.IncludeReadTracking) { &lt;/span&gt;&lt;span style="background: gold"&gt;#&amp;gt;
&lt;/span&gt;&lt;span style="color: red"&gt;                &lt;/span&gt;&lt;span style="color: gray"&gt;OnPropertyRead("&lt;/span&gt;&lt;span style="background: gold"&gt;&amp;lt;#=&lt;/span&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt; column.Member &lt;/span&gt;&lt;span style="background: gold"&gt;#&amp;gt;&lt;/span&gt;&lt;span style="color: gray"&gt;") 
&lt;/span&gt;&lt;span style="background: gold"&gt;&amp;lt;#&lt;/span&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt;                } &lt;/span&gt;&lt;span style="background: gold"&gt;#&amp;gt;
&lt;/span&gt;&lt;span style="color: red"&gt;                &lt;/span&gt;&lt;span style="color: gray"&gt;Return &lt;/span&gt;&lt;span style="background: gold"&gt;&amp;lt;#=&lt;/span&gt;&lt;span style="background: #f0f8ff; color: #191970"&gt;column.StorageValue&lt;/span&gt;&lt;span style="background: gold"&gt;#&amp;gt;
&lt;/span&gt;&lt;span style="color: red"&gt;            &lt;/span&gt;&lt;span style="color: gray"&gt;End Get&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;That's it for our modifications to the T4 templates. When we save the template, our classes will be regenerated. So how do we consume these? We will need to have a logging implementation which we somehow attach to the new event.&amp;nbsp; A simple case could be to do something like the following:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;Private &lt;/span&gt;Logger &lt;span style="color: blue"&gt;As New &lt;/span&gt;HashSet(&lt;span style="color: blue"&gt;Of String&lt;/span&gt;)
&lt;span style="color: blue"&gt;Sub &lt;/span&gt;Main()
    &lt;span style="color: blue"&gt;Dim &lt;/span&gt;dc &lt;span style="color: blue"&gt;As New &lt;/span&gt;NWindDataContext
    &lt;span style="color: blue"&gt;Dim &lt;/span&gt;emps = dc.Employees.ToList

    &lt;span style="color: blue"&gt;For Each &lt;/span&gt;emp &lt;span style="color: blue"&gt;In &lt;/span&gt;emps
        &lt;span style="color: blue"&gt;AddHandler &lt;/span&gt;emp.PropertyRead, &lt;span style="color: blue"&gt;AddressOf &lt;/span&gt;LogHandler
        Console.WriteLine(emp.FirstName &amp;amp; emp.LastName)
    &lt;span style="color: blue"&gt;Next

    &lt;/span&gt;Console.WriteLine(&lt;span style="color: #a31515"&gt;"Log results"&lt;/span&gt;)
    &lt;span style="color: blue"&gt;For Each &lt;/span&gt;item &lt;span style="color: blue"&gt;In &lt;/span&gt;Logger
        Console.WriteLine(item)
    &lt;span style="color: blue"&gt;Next
End Sub

Public Sub &lt;/span&gt;LogHandler(&lt;span style="color: blue"&gt;ByVal &lt;/span&gt;sender &lt;span style="color: blue"&gt;As Object&lt;/span&gt;, &lt;span style="color: blue"&gt;ByVal &lt;/span&gt;e &lt;span style="color: blue"&gt;As &lt;/span&gt;PropertyReadEventArgs)
    &lt;span style="color: blue"&gt;Dim &lt;/span&gt;value &lt;span style="color: blue"&gt;As String &lt;/span&gt;= sender.GetHashCode.ToString &amp;amp; e.PropertyName
    &lt;span style="color: blue"&gt;If Not &lt;/span&gt;Logger.Contains(value) &lt;span style="color: blue"&gt;Then &lt;/span&gt;Logger.Add(value)
&lt;span style="color: blue"&gt;End Sub&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Here we are fetching the employees from a context set up against Northwind. As we iterate through the employee list, we add a listener to the PropertyRead event to perform the logging. In the logger we somehow need to identify the object that is being logged and the property being read. Here we just track the object's GetHashCode and the arg's PropertyName. Of course you would need to figure out how to log based on the object's unique key. Since you have a handle on the actual sender object, you could determine this from the LINQ to SQL attributes for the IsPrimaryKey value, or you could use some other implementation. Once you have the items logged, saving them back to your persistence store would need to be an additional step added wherever you are calling submit changes.&lt;/p&gt;
&lt;p&gt;This sample also suffers from having to manually add the listener to the PropertyRead event. There are plenty of alternative options here, including using MEF to attach your object to a centralized logger. You would need to make the necessary changes to the T4 template, but hopefully that won't be too hard for you after reading this post.&lt;/p&gt;
&lt;p&gt;Also, realize that this technique works when working directly with the LINQ to SQL generated classes. However, if you project into an anonymous type, you will no longer receive read notifications as that generated type won't have the necessary hooks any more. When doing read auditing, the challenges build quickly. You may want to consider instead some third party server based profiling systems for a more robust implementation and leave the logging out of the client tier entirely.&lt;/p&gt;
&lt;p&gt;As always, there are plenty of alternatives. Let me know if you thinq of others.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=tyoRf3nFzRU:RCxW51I-qJA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=tyoRf3nFzRU:RCxW51I-qJA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=tyoRf3nFzRU:RCxW51I-qJA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=tyoRf3nFzRU:RCxW51I-qJA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=tyoRf3nFzRU:RCxW51I-qJA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=tyoRf3nFzRU:RCxW51I-qJA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=tyoRf3nFzRU:RCxW51I-qJA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=tyoRf3nFzRU:RCxW51I-qJA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=tyoRf3nFzRU:RCxW51I-qJA:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=tyoRf3nFzRU:RCxW51I-qJA:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/thinqlinq/rss/~4/tyoRf3nFzRU" height="1" width="1"/&gt;</description>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=1">LINQ</category>
    <feedburner:origLink>http://www.thinqlinq.com/Default/Adding-Property-Get-logging-to-LINQ-to-SQL-with-T4.aspx</feedburner:origLink></item>
    <item>
      <title>LINQ to SQL DataLoadOptions.LoadWith and Take</title>
      <link>http://feedproxy.google.com/~r/thinqlinq/rss/~3/F-PELonqVXM/LINQ-to-SQL-DataLoadOptions.LoadWith-and-Take.aspx</link>
      <pubDate>Wed, 15 Jul 2009 11:58:00 GMT</pubDate>
      <guid isPermaLink="false">42f563c8-34ea-4d01-bfe1-2047c2222a74:22071</guid>
      <dc:creator>jwooley</dc:creator>
      <slash:comments>0</slash:comments>
      <comments>http://www.thinqlinq.com/Default/LINQ-to-SQL-DataLoadOptions.LoadWith-and-Take.aspx</comments>
      <wfw:commentRss>http://www.thinqlinq.com/CommentRss.aspx?PostId=22071</wfw:commentRss>
      <wfw:comment>http://www.thinqlinq.com/Default/LINQ-to-SQL-DataLoadOptions.LoadWith-and-Take.aspx</wfw:comment>
      <description>&lt;p&gt;While trying to increase the performance of this site, I found a bug which may drastically slow the performance. By default when navigating to child objects from a parent object, LINQ to SQL lazy loads the children. This is good when you don't know if you want the children. &lt;/p&gt; &lt;p&gt;However, on this site when viewing posts, I ALWAYS display the categories and number of comments. As mentioned in &lt;a href="http://LinqInAction.net"&gt;LINQ in Action&lt;/a&gt;, you can eager load child records using the context's LoadOptions to set the child to be eagerly loaded with the parent using the following:&lt;/p&gt;&lt;pre&gt;&lt;code class="vbasic"&gt;
Dim dc As New LinqBlogDataContext
Dim options As New DataLoadOptions
options.LoadWith(Function(p As PostItem) p.CategoryPosts)
options.LoadWith(Function(cp As CategoryPost) cp.Category)
options.LoadWith(Function(p As PostItem) p.Comments)
dc.LoadOptions = options
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There are a couple issues with the implementation at this point however. First, the LoadWith setting only works for one level of hierarchy. It does not automatically navigate to grandchildren records. In this case, you may need to project into an anonymous type to remove that extra level of the object graph.&lt;/p&gt;
&lt;p&gt;The trickier situation comes when trying to do paging over the result sets. When traversing one level, the LoadOptions work fine for standard queries, however as soon as you throw a Take clause in, the LoadWith options are ignored as shown below:&lt;/p&gt;&lt;pre&gt;&lt;code class="vbasic"&gt;
Dim good =  From p In dc.PostItems _
            Order By p.PubDate Descending _
            Select p

Dim bad =   From p In dc.PostItems _
            Order By p.PubDate Descending _
            Take 5
            Select p
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the first case, a single query is sent to the database when navigating to the children. In the second (bad) query, separate statements are sent to the database as we fetch the children. I submitted a &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=473333"&gt;bug item&lt;/a&gt; on this. The solution here (if you target the 4.0 framework) is to include a Skip(0) clause which will cause the Take to not short circuit the LoadOptions:&lt;/p&gt;&lt;pre&gt;&lt;code class="vbasic"&gt;
Dim fixed = From p In dc.PostItems _
            Order By p.PubDate Descending _
            Skip 0
            Take 5
            Select p
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Unfortunately, this trick doesn't work with the current VS 2010 build when targeting 3.5. I suspect that you may need to target 4.0 in order to get Take to play nice with the LoadOptions.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=F-PELonqVXM:UY3UfSFwVxg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=F-PELonqVXM:UY3UfSFwVxg:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=F-PELonqVXM:UY3UfSFwVxg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=F-PELonqVXM:UY3UfSFwVxg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=F-PELonqVXM:UY3UfSFwVxg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=F-PELonqVXM:UY3UfSFwVxg:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=F-PELonqVXM:UY3UfSFwVxg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=F-PELonqVXM:UY3UfSFwVxg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=F-PELonqVXM:UY3UfSFwVxg:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=F-PELonqVXM:UY3UfSFwVxg:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/thinqlinq/rss/~4/F-PELonqVXM" height="1" width="1"/&gt;</description>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=16">VS 2010</category>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=1">LINQ</category>
    <feedburner:origLink>http://www.thinqlinq.com/Default/LINQ-to-SQL-DataLoadOptions.LoadWith-and-Take.aspx</feedburner:origLink></item>
    <item>
      <title>Binding Anonymous Types in MVC Views</title>
      <link>http://feedproxy.google.com/~r/thinqlinq/rss/~3/Jy6V7so6Xus/Binding-Anonymous-Types-in-MVC-Views.aspx</link>
      <pubDate>Sun, 12 Jul 2009 21:20:00 GMT</pubDate>
      <guid isPermaLink="false">42f563c8-34ea-4d01-bfe1-2047c2222a74:22070</guid>
      <dc:creator>jwooley</dc:creator>
      <slash:comments>0</slash:comments>
      <comments>http://www.thinqlinq.com/Default/Binding-Anonymous-Types-in-MVC-Views.aspx</comments>
      <wfw:commentRss>http://www.thinqlinq.com/CommentRss.aspx?PostId=22070</wfw:commentRss>
      <wfw:comment>http://www.thinqlinq.com/Default/Binding-Anonymous-Types-in-MVC-Views.aspx</wfw:comment>
      <description>&lt;p&gt;While translating this site over to MVC, I ran into a challenge when converting the RSS feed implementation. Currently I'm using XML Literals to generate the RSS and I could certainly continue to use that track from the Controller &lt;a href="http://www.mikesdotnetting.com/Article.aspx?ArticleID=111"&gt;similar to the Sitemap implementation on Mikesdotnetting&lt;/a&gt;. However, putting the XML generation in the controller directly conflicts with the separation of concerns that MVC embraces. If I were only displaying one RSS feed, I might be willing to break this here. However, I'm rendering a number of different RSS feeds here: Posts, Posts by Category, and Files.&lt;/p&gt; &lt;p&gt;Since it would be good to have a reusable view, I decided to create a single view which various controllers can use. I was dynamically generating the XML in the past so my queries would now need to project into a type that the view can consume. Here we have several alternatives:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Create a strongly typed object structure which is strictly used to shape our results for the shared Rss view.  &lt;li&gt;Project into a list of System.ServiceModel.SyndicationItem and then bind to that.  &lt;li&gt;Project into an anonymous type and figure out a way to bind to that projection in our view.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;I initially thought I would go down the second route similar to the &lt;a href="http://www.developerzen.com/2009/01/11/aspnet-mvc-rss-feed-action-result/"&gt;implementation discussed on the DeveloperZen post&lt;/a&gt;. However, I wanted to support some of the RSS extensions including comments and enclosures that aren't directly supported in that implementation.&lt;/p&gt; &lt;p&gt;At first I was unsure how to bind an anonymous projection in a View, so I eliminated option 3 and implemented option 1 similar to the &lt;a href="http://www.mikesdotnetting.com/Article.aspx?ArticleID=105"&gt;strongly typed implementation discussed on Mikesdotnetting&lt;/a&gt; blog. To do this, I needed to build the following set of strongly typed structures:&lt;/p&gt;&lt;pre&gt;&lt;code class="vbasic"&gt;
Public Structure RssElement
    Public Title As String
    Public Link As String
    Public PubDate As DateTime
    Public PermaLink As String
    Public TrackBackUrl As String
    Public CommentRss As String
    Public CommentUrl As String
    Public CommentCount As Integer
    Public Description As String
    Public Categories() As Category
    Public Enclosures() As Enclosure
End Structure

Public Structure Category
    Public Url As String
    Public Title As String
End Structure

Public Structure Enclosure
    Public Url As String
    Public Length As Integer
    Public Type As String
End Structure&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If I were using VB 10, this would have been done with auto-implemented properties. However I went with structures at this point because I didn't want to type that much for something that was going to be view only anyway. &lt;/p&gt;
&lt;p&gt;With this structure in place, I could go ahead and implement the controller and view. The controller simply projected into this new object structure in the Select clause of a LINQ query. The view then was able to consume this as we could strongly type the view as a ModelView(Of IEnumerable(Of RssElement)). Here's the view that I created:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: #a31515"&gt;Page &lt;/span&gt;&lt;span style="color: red"&gt;Language&lt;/span&gt;&lt;span style="color: blue"&gt;="VB" &lt;/span&gt;&lt;span style="color: red"&gt;ContentType&lt;/span&gt;&lt;span style="color: blue"&gt;="application/rss+xml"&lt;br&gt;        &lt;/span&gt;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;span style="color: red"&gt;Inherits&lt;/span&gt;&lt;span style="color: blue"&gt;="System.Web.Mvc.ViewPage(Of IEnumerable(Of RssElement))" &lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;rss &lt;/span&gt;&lt;span style="color: red"&gt;version&lt;/span&gt;&lt;span style="color: blue"&gt;='2.0' &lt;/span&gt;&lt;span style="color: #a31515"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;dc&lt;/span&gt;&lt;span style="color: blue"&gt;='http://purl.org/dc/elements/1.1/' 
    &lt;/span&gt;&lt;span style="color: #a31515"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;slash&lt;/span&gt;&lt;span style="color: blue"&gt;='http://purl.org/rss/1.0/modules/slash/' 
    &lt;/span&gt;&lt;span style="color: #a31515"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;wfw&lt;/span&gt;&lt;span style="color: blue"&gt;='http://wellformedweb.org/CommentAPI/'
    &lt;/span&gt;&lt;span style="color: #a31515"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;trackback&lt;/span&gt;&lt;span style="color: blue"&gt;='http://madskills.com/public/xml/rss/module/trackback'&amp;gt;
   &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;channel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
       &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;Thinq Linq&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
       &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;link&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;Url.Action(&lt;span style="color: #a31515"&gt;"Post"&lt;/span&gt;) &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;link&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
       &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;description&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;LINQ and related topics.&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;description&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
       &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;dc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;language&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;en-US&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;dc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;language&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
       &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;generator&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;LINQ&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;generator&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
       &lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color: blue"&gt;For Each &lt;/span&gt;item &lt;span style="color: blue"&gt;In &lt;/span&gt;Model&lt;span style="background: #ffee62"&gt;%&amp;gt;
&lt;/span&gt;            &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;item&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;item.Title&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;link&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;item.Link&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;link&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;pubDate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;item.PubDate&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;pubDate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;guid &lt;/span&gt;&lt;span style="color: red"&gt;isPermaLink&lt;/span&gt;&lt;span style="color: blue"&gt;="false"&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;= &lt;/span&gt;item.PermaLink &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;guid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;dc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;creator&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;jwooley&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;dc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;creator&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;slash&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;comments&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;item.CommentCount&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;slash&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;comments&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;trackback&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ping&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;item.TrackBackUrl&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;trackback&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ping&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;comments&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;item.CommentUrl&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;comments&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;wfw&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;commentRss&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;item.CommentRss&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;wfw&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;commentRss&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;wfw&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;comment&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;item.CommentUrl&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;wfw&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;comment&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;description&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;Html.Encode(item.Description)&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;description&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                      &lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color: blue"&gt;if Not &lt;/span&gt;item.Categories &lt;span style="color: blue"&gt;is Nothing then &lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&lt;/span&gt;                           &lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;For Each &lt;/span&gt;c &lt;span style="color: blue"&gt;In &lt;/span&gt;item.Categories&lt;span style="background: #ffee62"&gt;%&amp;gt;
&lt;/span&gt;                              &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;category &lt;/span&gt;&lt;span style="color: red"&gt;domain&lt;/span&gt;&lt;span style="color: blue"&gt;="&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;= c.Url &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;"&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;c.Title&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;category&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
                          &lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color: blue"&gt;Next &lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&lt;/span&gt;                      &lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color: blue"&gt;End If&lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&lt;/span&gt;                      &lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;If Not &lt;/span&gt;item.Enclosures &lt;span style="color: blue"&gt;is Nothing then &lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&lt;/span&gt;                          &lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color: blue"&gt;For Each &lt;/span&gt;e &lt;span style="color: blue"&gt;In &lt;/span&gt;item.Enclosures&lt;span style="background: #ffee62"&gt;%&amp;gt;
&lt;/span&gt;                                &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;enclosure 
                                    &lt;/span&gt;&lt;span style="color: red"&gt;url&lt;/span&gt;&lt;span style="color: blue"&gt;='&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;=e.Url &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;'
                                    &lt;/span&gt;&lt;span style="color: red"&gt;length&lt;/span&gt;&lt;span style="color: blue"&gt;='&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;=e.length &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;'
                                    &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;='&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;=e.type &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;' /&amp;gt;
                          &lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color: blue"&gt;Next&lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&lt;/span&gt;                      &lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color: blue"&gt;end if &lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&lt;/span&gt;                  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;item&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
       &lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color: blue"&gt;Next&lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&lt;/span&gt;   &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;channel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;rss&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In comparing this code with the XML Literal implementation, they are amazingly similar. With MVC, I may be able to live without XML Literals in the views as we simply replace a LINQ projection with a For Each loop. Notice here I check to see if the Categories and Enclosures objects exist before I enumerate over each of those arrays. This is because the Post feed doesn't include enclosures and the File feed doesn't need Categories. This flexibility allows us to create a reusable view for all of our needs. &lt;/p&gt;
&lt;p&gt;But, I'm not quite happy with this implementation. I would prefer not to have to declare the additional structure layer just to pass the view something to consume. In this case, it feels like we are having the Controller consume the data Model and create a ModelView (RssElement) to be consumed by the View. We don't really need a new pattern (M-C-MV-V), do we? Instead, I would like to be a bit more "Dynamic" in my implementation so that I didn't need this class and could simply project into an anonymous type and eliminate the RssElement structures entirely.&lt;/p&gt;
&lt;p&gt;After a bit of reflection, I realized that this is a case where VB is uniquely positioned crossing the bridge between strong typing and dynamic languages. Normally, I do not recommend using the Option Strict Off option, but this is one case where it does come in useful. To begin, we'll remove those pesky structures. Next, we'll change the controllers to project into anonymous types. Here's the revised code for the Post Rss Controller:&lt;/p&gt;&lt;pre&gt;&lt;code class="vbasic"&gt;
    Function ShowPosts() As ActionResult
        Dim posts = From p In (From post In Context.PostItems _
                    Order By post.PublicationDate Descending _
                    Take 20).AsEnumerable _
                    Select New With { _
                        .Description = p.Description, _
                        .Link = Url.Action("Title/" &amp;amp; p.TitleUrlRewrite &amp;amp; ".aspx", "Post"), _
                        .PubDate = p.PublicationDate.ToString("r"), _
                        .Title = p.Title, _
                        .TrackBackUrl = Url.Action("Trackback/" &amp;amp; p.Id, "Seo"), _
                        .PermaLink = "42f563c8-34ea-4d01-bfe1-2047c2222a74:" &amp;amp; p.Id, _
                        .Categories = (From c In p.CategoryPosts _
                                    Select New With { _
                                         .Title = c.Category.Title, _
                                         .Url = Url.Action("Category/" &amp;amp; c.CategoryID, _
                                                           "Post")}).ToArray, _
                        .Commentrss = Url.Action("Comment/" &amp;amp; p.Id, "Rss"), _
                        .CommentUrl = Url.Action("Title/" &amp;amp; p.TitleUrlRewrite, "Post"), _
                        .CommentCount = p.Comments.Count, _
                        .Enclosures = Nothing}

        Return View("ShowFeed", posts.ToList)
    End Function
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Notice here, that we have to be very careful with our property naming and can't leave off anything. This is why we have to initialize our .Enclosures property to Nothing because we can't initialize it to an empty collection. Since our view checks to see if the object is null before binding it, we are fine here.&lt;/p&gt;
&lt;p&gt;Now back to the view. How do we tell the view what type of data the Model contains if we can't name it? Here's where option strict off comes in handy. However, in a View page, we can't simply state Option Strict Off at the top of our code. Instead, we need to set the CompilerOptions to set optionstrict- as follows:&lt;/p&gt;&lt;pre&gt;&lt;code class="code"&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: #a31515"&gt;Page &lt;/span&gt;&lt;span style="color: red"&gt;Language&lt;/span&gt;&lt;span style="color: blue"&gt;="VB" &lt;/span&gt;&lt;span style="color: red"&gt;ContentType&lt;/span&gt;&lt;span style="color: blue"&gt;="application/rss+xml" &lt;br&gt;         &lt;/span&gt;&lt;span style="color: red"&gt;CompilerOptions&lt;/span&gt;&lt;span style="color: blue"&gt;="/optionstrict-" &lt;/span&gt;&lt;span style="color: red"&gt;Inherits&lt;/span&gt;&lt;span style="color: blue"&gt;="System.Web.Mvc.ViewPage" &lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&lt;font style="background-color: #ffffff" face="Trebuchet MS"&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this case, we are not only setting the CompilerOptions, but removing the generic type definition in the Inherits clause. The rest of the view remains intact. Now, we can consume our anonymous type (because we aren't typing the view) and let the Option Strict setting dynamically resolve our method and type names. Notice here, if we were using C# 4.0, we wouldn't be able to use the Dynamic option and state that the page inherits ViewPage&amp;lt;Dynamic&amp;gt; because we can't project into a Dynamic type in our LINQ query.&lt;/p&gt;&lt;p&gt;Now that we have modified our view, we can reuse it. First move it to the Shared folder so that the view will be accessible regardless of which controller tries to consume it. Next, we create other controllers making sure that all of the properties are projected correctly in our LINQ query. &lt;/p&gt;&lt;pre&gt;&lt;code class="vbasic"&gt;
    Function Rss() As ActionResult
        Return View("ShowFeed", _
            From f In GetFiles() _
            Select New With { _
                .Description = f.Description, _
                .Link = "http://www.ThinqLinq.com/" &amp;amp; f.URL, _
                .PubDate = f.LastWriteTime.ToString("r"), _
                .PermaLink = "42f563c8-34ea-4d01-bfe1-2047c2222a74:" &amp;amp; f.Name, _
                .TrackBackUrl = "", _
                .CommentRss = "", _
                .CommentUrl = "", _
                .CommentCount = 0, _
                .Categories = Nothing, _
                .Title = f.Name, _
                .Enclosures = New Object() {New With { _
                                            .Length = f.Length, _
                                            .Type = "application/x-zip-compressed", _
                                            .Url = "http://www.ThinqLinq.com/" &amp;amp; f.URL}}})
    End Function&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Be aware. Here we are playing with the dangerous part of dynamic languages. We no longer get the compiler to ensure that our type includes all of the necessary properties. If we forget a property or mis-type the property name, we will only know about it when a run-time exception is thrown. Of course, since this is MVC, we can use unit tests to check our type. With dynamic programming, think of the compiler as just another unit test. You need to write the rest of them by hand.&lt;/p&gt;&lt;p&gt;While I like the flexibility that the new dynamic option provides, I miss the comfort that comes from strong typing. Also, I haven't checked the performance differences between these implementations and suspect that the previous strongly typed option may out perform this one. With optimizations in VB 10 around Option Strict Off, I suspect that the performance differences may shrink, but would need to test this as well.&lt;/p&gt;&lt;p&gt;I'll also admit to being relatively new to MVC and welcome better alternatives from those who have been using it longer. What do you Thinq?&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=Jy6V7so6Xus:6QaEWN_gb_Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=Jy6V7so6Xus:6QaEWN_gb_Q:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=Jy6V7so6Xus:6QaEWN_gb_Q:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=Jy6V7so6Xus:6QaEWN_gb_Q:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=Jy6V7so6Xus:6QaEWN_gb_Q:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=Jy6V7so6Xus:6QaEWN_gb_Q:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=Jy6V7so6Xus:6QaEWN_gb_Q:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=Jy6V7so6Xus:6QaEWN_gb_Q:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=Jy6V7so6Xus:6QaEWN_gb_Q:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=Jy6V7so6Xus:6QaEWN_gb_Q:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/thinqlinq/rss/~4/Jy6V7so6Xus" height="1" width="1"/&gt;</description>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=9">VB Dev Center</category>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=7">VB</category>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=1">LINQ</category>
    <feedburner:origLink>http://www.thinqlinq.com/Default/Binding-Anonymous-Types-in-MVC-Views.aspx</feedburner:origLink></item>
    <item>
      <title>VB Syntax Highlighting with JQuery and Chili</title>
      <link>http://feedproxy.google.com/~r/thinqlinq/rss/~3/h2-YAESCAS8/VB-Syntax-Highlighting-with-JQuery-and-Chili.aspx</link>
      <pubDate>Fri, 10 Jul 2009 12:40:00 GMT</pubDate>
      <guid isPermaLink="false">42f563c8-34ea-4d01-bfe1-2047c2222a74:22069</guid>
      <dc:creator>jwooley</dc:creator>
      <slash:comments>0</slash:comments>
      <comments>http://www.thinqlinq.com/Default/VB-Syntax-Highlighting-with-JQuery-and-Chili.aspx</comments>
      <wfw:commentRss>http://www.thinqlinq.com/CommentRss.aspx?PostId=22069</wfw:commentRss>
      <wfw:comment>http://www.thinqlinq.com/Default/VB-Syntax-Highlighting-with-JQuery-and-Chili.aspx</wfw:comment>
      <description>&lt;p&gt;At CodeStock, I attended &lt;a href="http://codebetter.com/blogs/rodpaddock/archive/2009/04/07/jquery-101-ug-samples-and-slides.aspx"&gt;Rod Paddock's&lt;/a&gt; intro to JQuery session since I hadn't played with JQuery yet. As often happens when I go to conferences, being in the different environment starts to get the mind thinking in different ways. Sometimes the benefit of the conference isn't necessarily something stated directly, but rather a thought when the mind wanders. One such thought occurred during Rod's presentation where I thought that it might be interesting to "query" sets of text over a larger document and apply formatting to selected words (similar to how Visual Studio colors keywords and other code elements).&lt;/p&gt; &lt;p&gt;A quick search on syntax highlighting found that I was not alone thinking that JQuery might be a good option for syntax highlighting. &lt;a href="http://plugins.jquery.com/project/chili"&gt;Chili&lt;/a&gt; is a JQuery based code highlighter that already supports a number of languages. It is relatively easy to incorporate into the site. First, you need to add a script reference to JQuery by adding the following:&lt;/p&gt; &lt;blockquote&gt;&lt;pre&gt;&lt;code class="js"&gt;&amp;lt;script type="text/javascript" src=&lt;a href="http://jquery.com/src/jquery-latest.pack.js"&gt;http://jquery.com/src/jquery-latest.pack.js&lt;/a&gt;" /&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;Next, we add a link to the chili script code:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;&lt;code class="js"&gt;&amp;lt;script type="text/javascript" src="jquery/chili/jquery.chili-2.2.js" /&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;Third, we designate the path that contains the various language specific implementation details in a script block:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;&lt;code class="js"&gt;&amp;lt;script id="setup" type="text/javascript"&amp;gt; 
    ChiliBook.recipeFolder = "jquery/chili/";
&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;Now, when we want to add highlighting to our code, we include it inside a &amp;lt;code&amp;gt; tag that is assigned to the class name of the language we want to colorize. Unlike the popular &lt;a href="http://code.google.com/p/syntaxhighlighter/"&gt;SyntaxHighlighter&lt;/a&gt;, Chili doesn't require you to specify the location of each language individually. It loads it dynamically based on matching up the file name with the class name. &lt;/p&gt;
&lt;p&gt;To see how I added colorization to the source on the above code, see how the actual code is wrapped by a &amp;lt;code class="js"&amp;gt; … &amp;lt;/code&amp;gt; tag. In this case, there is a js.js file in the recipeFolder that Chili uses to highlight this code. In addition, I'm wrapping the code tag inside a pre tag to eliminate otherwise unnecessary markup (like &amp;amp;nbsp; and &amp;lt;br /&amp;gt;). This makes copying and pasting the code easier. &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;pre&amp;gt;&amp;lt;code class="js"&amp;gt;&lt;br&gt;&lt;pre&gt;&lt;code class="js"&gt;
  &amp;lt;script id="setup" type="text/javascript"&amp;gt;
     ChiliBook.recipeFolder = "jquery/chili/";
  &amp;lt;/script&amp;gt;&lt;br&gt;&lt;/code&gt;
&lt;pre&gt;&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&lt;p&gt;&lt;/p&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;There's a problem with directly integrating Chili into this site however. Chili does not include a native VB syntax highlighter. However, adding new code definitions is as simple as adding a new .js file containing a collection of JSON objects defining what terms are to be colorized and how the styles should be applied. For the current VB implementation, I've added the following colorizations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Comments are green 
&lt;li&gt;String literals are red 
&lt;li&gt;Processing instructions (like #Region and #If) are silver 
&lt;li&gt;Keywords and LINQ keywords are #4040c2 
&lt;li&gt;XML Literal expression hole symbols (&amp;lt;%= and %&amp;gt;) are a bit different as they use a yellow background with dark gray foreground, but we can easily set this through the style tag.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;To do this, we set up a JSON structure to contain the various Regular Expression match patterns and the corresponding styles:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;&lt;code class="js"&gt;{
      _name: "vb"
    , _case: true
    , _main: {
          com    : { 
              _match: /'.*/ 
            , _style: "color: green;"
        }
        , string : { 
              _match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ 
            , _style: "color: red;"
        }
        , preproc: { 
              _match: /^\s*#.*/ 
            , _style: "color: silver;"
        }
        , keyword: { 
              _match: /\b(?:AddHandler|AddressOf|AndAlso|Alias|And|Ansi|As|Assembly|Auto|
Boolean|ByRef|Byte|ByVal|Call|Case|Catch|
CBool|CByte|CChar|CDate|CDec|CDbl|Char|CInt|Class|CLng|CObj|
Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|
Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|Enum|Erase|Error|Event|Exit|
False|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|
If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|
Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|
Namespace|New|Next|Not|Nothing|NotInheritable|NotOverridable|
Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|
ParamArray|Preserve|Private|Property|Protected|Public|
RaiseEvent|ReadOnly|ReDim|REM|RemoveHandler|Resume|Return|
Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|
Sub|SyncLock|Then|Throw|To|True|Try|TypeOf|Unicode|Until|Variant|
When|While|With|WithEvents|WriteOnly|Xor)\b/ 
            , _style: "color: #4040c2;"
        }
        , linqkeyword: { 
              _match: /\b(?:From|Select|Where|Order By|Descending|Distinct
|Skip|Take|Aggregate|Sum|Count|Group|Join|Into|Equals)\b/ 
            , _style: "color: #4040c2;"
        }
        , xmlexpressionhole: {
              _match: /\&amp;lt;%=|\%&amp;gt;/
            , _style: "background: #fffebf; color: #555555;"
        }
    }
}&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;If you want, you can download this file at &lt;a title="http://thinqlinq.com/jquery/chili/vbasic.js" href="http://thinqlinq.com/jquery/chili/vbasic.js"&gt;http://thinqlinq.com/jquery/chili/vbasic.js&lt;/a&gt;. Now, to use the new definition, simply add the file to the path you defined as the chiliBook.RecipeFolder above. Then add code to your page like the following:&lt;/p&gt;&lt;pre&gt;&lt;code class="vbasic"&gt;
&amp;lt;pre&amp;gt;&amp;lt;code class="vbasic"&amp;gt;&lt;br&gt;   Private Function FormatCategories(ByVal post As PostItem) As String
        If post.CategoryPosts.Count &amp;gt; 0 Then
            'Categories found. Return them
            Dim response = _
                From catPost In post.CategoryPosts _
                Select val = _
                    &amp;lt;span&amp;gt;
                        &amp;lt;a href=&amp;lt;%= "default.aspx?CategoryId=" &amp;amp; _
                        catPost.Category.CategoryId %&amp;gt;&amp;gt;
                           &amp;lt;%= catPost.Category.Description.Trim %&amp;gt;&amp;lt;/a&amp;gt;
                    &amp;lt;/span&amp;gt;.ToString()
            Return String.Join(", ", response.ToArray)
        Else
            Return ""
        End If
    End Function&lt;br&gt;&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;There are a couple issues with this implementation: First, the highlighting only works if you view the page on the site. If you are viewing this through an aggregator, you won't see the syntax highlighting. Personally, I find this to be an acceptable tradeoff to the alternative--injecting the styles inline with the code as is done with the &lt;a href="http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/"&gt;CopySourceAsHtml&lt;/a&gt; project or the &lt;a href="http://www.11011.net/software/vspaste"&gt;Windows Live Writer VSPaste plug-in&lt;/a&gt;. Although the code is correctly highlighted when viewed from an aggregator, it is horrendous when consumed by a reader for the blind with screen reader systems.&lt;/p&gt;
&lt;p&gt;The second issue with this implementation is that it doesn't take context into account. As a result, if you have an object with the same name as one of the keywords, it will be highlighted&amp;nbsp; incorrectly. This will become more of an issue in VS 2010 when we (finally) get type colorization in VB. To do type colorization, we need access to the object symbols which are unavailable outside of the compiler's environment.&lt;/p&gt;
&lt;p&gt;The third issue is that this version doesn't correctly colorize the XML Literals. While I'm sure it is possible, I'm not enough of a Regular Expression expert to figure out all of the options required to enable syntax highlighting for the XML Literals. If someone wants to add that, I would love to try out your suggestions.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=h2-YAESCAS8:xcg9nTNuOgw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=h2-YAESCAS8:xcg9nTNuOgw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=h2-YAESCAS8:xcg9nTNuOgw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=h2-YAESCAS8:xcg9nTNuOgw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=h2-YAESCAS8:xcg9nTNuOgw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=h2-YAESCAS8:xcg9nTNuOgw:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=h2-YAESCAS8:xcg9nTNuOgw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=h2-YAESCAS8:xcg9nTNuOgw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=h2-YAESCAS8:xcg9nTNuOgw:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=h2-YAESCAS8:xcg9nTNuOgw:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/thinqlinq/rss/~4/h2-YAESCAS8" height="1" width="1"/&gt;</description>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=7">VB</category>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=22">JQuery</category>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=9">VB Dev Center</category>
    <feedburner:origLink>http://www.thinqlinq.com/Default/VB-Syntax-Highlighting-with-JQuery-and-Chili.aspx</feedburner:origLink></item>
    <item>
      <title>Disable Historical Debugger when using MVC with VS 2010 beta1</title>
      <link>http://feedproxy.google.com/~r/thinqlinq/rss/~3/-N99En3Nkbo/Disable-Historical-Debugger-when-using-MVC-with-VS-2010-beta1.aspx</link>
      <pubDate>Wed, 08 Jul 2009 15:06:00 GMT</pubDate>
      <guid isPermaLink="false">42f563c8-34ea-4d01-bfe1-2047c2222a74:22068</guid>
      <dc:creator>jwooley</dc:creator>
      <slash:comments>0</slash:comments>
      <comments>http://www.thinqlinq.com/Default/Disable-Historical-Debugger-when-using-MVC-with-VS-2010-beta1.aspx</comments>
      <wfw:commentRss>http://www.thinqlinq.com/CommentRss.aspx?PostId=22068</wfw:commentRss>
      <wfw:comment>http://www.thinqlinq.com/Default/Disable-Historical-Debugger-when-using-MVC-with-VS-2010-beta1.aspx</wfw:comment>
      <description>&lt;p&gt;I've had a bit of down time between contracts recently and have been taking the opportunity to learn some technologies that I haven't had time to get into before. Since I've read so much about it, I thought I would try out ASP.Net MVC. Since it was just for fun, I figured I'd bite the bullet and try it under VS 2010. &lt;/p&gt; &lt;p&gt;I build a small sample following the tutorials at &lt;a title="http://www.asp.net/learn/mvc/" href="http://www.asp.net/learn/mvc/"&gt;http://www.asp.net/learn/mvc/&lt;/a&gt;, however when I try to run it in VS 2010, the app crashes on me. There's enough "Magic" going on inside MVC, including the routing engine and dynamic loading of the controllers and views that trying to debug MVC is challenging enough when the IDE behaves. When it doesn't it makes life significantly more problematic. Naturally VS hard crashes rather than breaking in my code to let me figure out what's going wrong. &lt;/p&gt; &lt;p&gt;It turns out there wasn't a problem in my code, but rather an issue with MVC and the Historical Debugger which is turned on by default in VS 2010. To fix the issue, open the Option dialog (under Tools - Options) and locate the Historical Debugger tab. Uncheck the "Enable Historic Debugging" option.&lt;/p&gt; &lt;p&gt;&lt;a href="http://thinqlinq.com/Images/DisableHistoricalDebuggerwhenusingMVCwit_DEAD/image.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Historical Debugging Option Screen" border="0" alt="Historical Debugging Option Screen" src="http://thinqlinq.com/Images/DisableHistoricalDebuggerwhenusingMVCwit_DEAD/image_thumb.png" width="644" height="385"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/webdevtools/archive/2009/06/17/asp-net-mvc-for-visual-studio-2010-beta1-codeplex.aspx"&gt;Joe Cartano&lt;/a&gt; of the ASP team assures us that this will be fixed in Beta 2, so hopefully this is only a temporary situation. Maybe next time I'll remember to read the release notes completely before banging my head against the wall.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=-N99En3Nkbo:QO8WDzneHe8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=-N99En3Nkbo:QO8WDzneHe8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=-N99En3Nkbo:QO8WDzneHe8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=-N99En3Nkbo:QO8WDzneHe8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=-N99En3Nkbo:QO8WDzneHe8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=-N99En3Nkbo:QO8WDzneHe8:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=-N99En3Nkbo:QO8WDzneHe8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=-N99En3Nkbo:QO8WDzneHe8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=-N99En3Nkbo:QO8WDzneHe8:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=-N99En3Nkbo:QO8WDzneHe8:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/thinqlinq/rss/~4/-N99En3Nkbo" height="1" width="1"/&gt;</description>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=16">VS 2010</category>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=21">MVC</category>
    <feedburner:origLink>http://www.thinqlinq.com/Default/Disable-Historical-Debugger-when-using-MVC-with-VS-2010-beta1.aspx</feedburner:origLink></item>
    <item>
      <title>LINQ Bootcamp coming to Birmingham, AL</title>
      <link>http://feedproxy.google.com/~r/thinqlinq/rss/~3/lbjmTLE-qWs/LINQ-Bootcamp-coming-to-Birmingham,-AL.aspx</link>
      <pubDate>Wed, 08 Jul 2009 10:30:00 GMT</pubDate>
      <guid isPermaLink="false">42f563c8-34ea-4d01-bfe1-2047c2222a74:22067</guid>
      <dc:creator>jwooley</dc:creator>
      <slash:comments>0</slash:comments>
      <comments>http://www.thinqlinq.com/Default/LINQ-Bootcamp-coming-to-Birmingham,-AL.aspx</comments>
      <wfw:commentRss>http://www.thinqlinq.com/CommentRss.aspx?PostId=22067</wfw:commentRss>
      <wfw:comment>http://www.thinqlinq.com/Default/LINQ-Bootcamp-coming-to-Birmingham,-AL.aspx</wfw:comment>
      <description>&lt;p&gt;If you are in the Birmingham, AL area on July 25-26, consider signing up for the free two day LINQ Bootcamp event. I'm hoping to be there to help answer your questions as well. If you're interested in more information, here's a copy of the &lt;a href="http://altechevents.com/2009/07/07/bsda-meeting-for-july-9th-2009-intro-to-wcf/"&gt;original announcement&lt;/a&gt;:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;…The upcoming LINQ Bootcamp [will be] on July 25th and 26th. To register for this great event please go to &lt;a href="http://www.clicktoattend.com/?id=139378"&gt;http://www.clicktoattend.com/?id=139378&lt;/a&gt; . Seating is limited to this free event. We still need volunteers for presenting, currently more than half the chapters are still available. Your participation is needed to make this event a success so be ready to pick out a chapter when you arrive, first come first serve. You can also e-mail us at &lt;a href="mailto:BhamSoftwareDevAssoc@live.com"&gt;BhamSoftwareDevAssoc@live.com&lt;/a&gt; to volunteer or get more info. &lt;p&gt;Update: as of 7/6/09 Chapters 3, 9, 10, 11, and 12 have been volunteered for, other chapters are still open to potential presenters. All presenters will get a free copy of the book.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Unfortunately, the book in question isn't "&lt;a href="http://linqinaction.net"&gt;LINQ in Action&lt;/a&gt;", but it should be a good event regardless.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=lbjmTLE-qWs:5GKkSpZ1tIs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=lbjmTLE-qWs:5GKkSpZ1tIs:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=lbjmTLE-qWs:5GKkSpZ1tIs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=lbjmTLE-qWs:5GKkSpZ1tIs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=lbjmTLE-qWs:5GKkSpZ1tIs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=lbjmTLE-qWs:5GKkSpZ1tIs:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=lbjmTLE-qWs:5GKkSpZ1tIs:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=lbjmTLE-qWs:5GKkSpZ1tIs:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=lbjmTLE-qWs:5GKkSpZ1tIs:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=lbjmTLE-qWs:5GKkSpZ1tIs:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/thinqlinq/rss/~4/lbjmTLE-qWs" height="1" width="1"/&gt;</description>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=1">LINQ</category>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=2">Code Camp</category>
    <feedburner:origLink>http://www.thinqlinq.com/Default/LINQ-Bootcamp-coming-to-Birmingham,-AL.aspx</feedburner:origLink></item>
    <item>
      <title>How do Stored Procs fit with LINQ</title>
      <link>http://feedproxy.google.com/~r/thinqlinq/rss/~3/amCckz_tM0k/How-do-Stored-Procs-fit-with-LINQ.aspx</link>
      <pubDate>Mon, 06 Jul 2009 10:48:00 GMT</pubDate>
      <guid isPermaLink="false">42f563c8-34ea-4d01-bfe1-2047c2222a74:22066</guid>
      <dc:creator>jwooley</dc:creator>
      <slash:comments>1</slash:comments>
      <comments>http://www.thinqlinq.com/Default/How-do-Stored-Procs-fit-with-LINQ.aspx</comments>
      <wfw:commentRss>http://www.thinqlinq.com/CommentRss.aspx?PostId=22066</wfw:commentRss>
      <wfw:comment>http://www.thinqlinq.com/Default/How-do-Stored-Procs-fit-with-LINQ.aspx</wfw:comment>
      <description>&lt;p&gt;At &lt;a href="http://www.codestock.org"&gt;Codestock&lt;/a&gt;, &lt;a href="http://www.davidgiard.com/2009/07/05/JimWooleyOnStoredProceduresAndDataAccess.aspx"&gt;David Giard&lt;/a&gt; asked me about the pros and cons of using stored procedures or using OR/M tools like LINQ to SQL or Entity Framework. There is no silver bullet in terms of which to use. In many cases you need to use a combination of techniques depending on your particular needs. Watch the video to see what you need to consider when making this decision.&lt;/p&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="viddler_ce93ee6d" width="437" height="348"&gt;&lt;param name="movie" value="http://www.viddler.com/simple/ce93ee6d/"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;embed src="http://www.viddler.com/simple/ce93ee6d/" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" name="viddler_ce93ee6d" width="437" height="348"&gt;&lt;/object&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=amCckz_tM0k:rx-ohDHPsU4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=amCckz_tM0k:rx-ohDHPsU4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=amCckz_tM0k:rx-ohDHPsU4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=amCckz_tM0k:rx-ohDHPsU4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=amCckz_tM0k:rx-ohDHPsU4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=amCckz_tM0k:rx-ohDHPsU4:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=amCckz_tM0k:rx-ohDHPsU4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=amCckz_tM0k:rx-ohDHPsU4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=amCckz_tM0k:rx-ohDHPsU4:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=amCckz_tM0k:rx-ohDHPsU4:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/thinqlinq/rss/~4/amCckz_tM0k" height="1" width="1"/&gt;</description>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=1">LINQ</category>
    <feedburner:origLink>http://www.thinqlinq.com/Default/How-do-Stored-Procs-fit-with-LINQ.aspx</feedburner:origLink></item>
    <item>
      <title>Iterators OR Excuse me waiter theres a goto in my C sharp</title>
      <link>http://feedproxy.google.com/~r/thinqlinq/rss/~3/rzmLkrSkAlg/Iterators-OR-Excuse-me-waiter-theres-a-goto-in-my-C-sharp.aspx</link>
      <pubDate>Mon, 29 Jun 2009 16:30:00 GMT</pubDate>
      <guid isPermaLink="false">42f563c8-34ea-4d01-bfe1-2047c2222a74:22065</guid>
      <dc:creator>jwooley</dc:creator>
      <slash:comments>1</slash:comments>
      <comments>http://www.thinqlinq.com/Default/Iterators-OR-Excuse-me-waiter-theres-a-goto-in-my-C-sharp.aspx</comments>
      <wfw:commentRss>http://www.thinqlinq.com/CommentRss.aspx?PostId=22065</wfw:commentRss>
      <wfw:comment>http://www.thinqlinq.com/Default/Iterators-OR-Excuse-me-waiter-theres-a-goto-in-my-C-sharp.aspx</wfw:comment>
      <description>&lt;p&gt;At &lt;a href="http://codestock.org"&gt;Codestock&lt;/a&gt; '09, I gave my LINQ Internals talk and had a number of people express shock when I showed the underlying implementation of their beloved iterators when looking at the code through Reflector. Let's look first at the C# that we wrote. This is similar to the implementation of LINQ to Object's Where method as shown in the sequence.cs file that's part of the &lt;a href="http://code.msdn.microsoft.com/csharpsamples"&gt;C# Samples&lt;/a&gt;.&lt;/p&gt;&lt;pre&gt;&lt;code class="csharp"&gt;
public static IEnumerable&lt;char&gt; Where(this QueryableString source, Func&lt;char bool ,&gt; predicate)
{
   foreach (char curChar in source)
        if (predicate(curChar))
            yield return curChar;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;C# Iterators aren't really first class citizens, but syntactic sugar around the actual implementation. The meat of the implementation occurs in a generated class that implements the actual MoveNext method as we foreach over the results. The results are much less pretty:&lt;/p&gt;&lt;pre&gt;&lt;code class="csharp"&gt;
private bool MoveNext()
{
    bool CS$1$0000;
    try
    {
        switch (this.1__state)
        {
            case 0:
                break;

            case 2:
                goto Label_0087;

            default:
                goto Label_00A5;
        }
        this.1__state = -1;
        this.7__wrap2 = this.4__this.GetEnumerator();
        this.1__state = 1;
        while (this.7__wrap2.MoveNext())
        {
            this.&amp;lt;curString&amp;gt;5__1 = this.7__wrap2.Current;
            if (!this.predicate(this.&amp;lt;curString&amp;gt;5__1))
            {
                continue;
            }
            this.2__current = this.&amp;lt;curString&amp;gt;5__1;
            this.1__state = 2;
            return true;
        Label_0087:
            this.1__state = 1;
        }
        this.m__Finally4();
    Label_00A5:
        CS$1$0000 = false;
    }
    fault
    {
        this.System.IDisposable.Dispose();
    }
    return CS$1$0000;
}

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see, the iterator sets up a switch (Select Case) statement that checks to see where we are in the loop (using a state variable). Essentially this is a state machine. The first time through we set up the environment. As we iterate over the results, we call the predicate that was passed in. If the predicate evaluates as true, we exit out of the method returning true. &lt;/p&gt;
&lt;p&gt;The next time we return to the MoveNext, we use goto Label_0087 to re-enter the loop and continue the iteration. It's at this point that the jaws dropped in my presentation. Yes, Virginia, there are "Goto's" in C#. Spaghetti code isn't limited to VB. It's this point in my presentation where I quipped that the reason why iterators aren't in VB yet is because we want to do them "Right". While this is partly a joke, there is a level of seriousness in the comment. If you want to dig deeper on iterators, I recommend the following for your reading pleasure (note, these are NOT for the faint of heart):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Wes Dyer's excellent &lt;a href="http://blogs.msdn.com/wesdyer/archive/2007/03/23/all-about-iterators.aspx"&gt;blog post on C# iterators&lt;/a&gt;. 
&lt;li&gt;Bart Jacobs, Erik Meijer, et al, &lt;a href="http://citeseer.ist.psu.edu/cache/papers/cs2/355/http:zSzzSzwww.cs.kuleuven.ac.bezSz~frankzSzPAPERSzSzFTfJP2005.pdf/iterators-revisited-proof-rules.pdf"&gt;paper on Iterators&lt;/a&gt;. 
&lt;li&gt;If you want to do iterators over heirarchical structures (necessary for implementing iterators over streamed XML), check out &lt;a href="http://www.cse.dmu.ac.uk/~mward/martin/papers/"&gt;Martin Ward's thesis&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;After reading these, I'm sure you will have a better understanding of why it is taking so long to get iterators in VB. In the mean time, you might also find Bill McCarthy's recent article on using &lt;a href="http://visualstudiomagazine.com/articles/2009/02/01/use-iterators-in-vb-now.aspx"&gt;Iterators in VB Now&lt;/a&gt; to be interesting.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=rzmLkrSkAlg:Jl9x8brPycI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=rzmLkrSkAlg:Jl9x8brPycI:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=rzmLkrSkAlg:Jl9x8brPycI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=rzmLkrSkAlg:Jl9x8brPycI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=rzmLkrSkAlg:Jl9x8brPycI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=rzmLkrSkAlg:Jl9x8brPycI:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=rzmLkrSkAlg:Jl9x8brPycI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=rzmLkrSkAlg:Jl9x8brPycI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=rzmLkrSkAlg:Jl9x8brPycI:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=rzmLkrSkAlg:Jl9x8brPycI:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/thinqlinq/rss/~4/rzmLkrSkAlg" height="1" width="1"/&gt;</description>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=7">VB</category>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=8">C#</category>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=1">LINQ</category>
    <feedburner:origLink>http://www.thinqlinq.com/Default/Iterators-OR-Excuse-me-waiter-theres-a-goto-in-my-C-sharp.aspx</feedburner:origLink></item>
    <item>
      <title>LINQ Tools coming to Russ Tool Shed</title>
      <link>http://feedproxy.google.com/~r/thinqlinq/rss/~3/X4PWIhow3cQ/LINQ-Tools-coming-to-Russ-Tool-Shed.aspx</link>
      <pubDate>Mon, 29 Jun 2009 09:07:00 GMT</pubDate>
      <guid isPermaLink="false">42f563c8-34ea-4d01-bfe1-2047c2222a74:22064</guid>
      <dc:creator>jwooley</dc:creator>
      <slash:comments>0</slash:comments>
      <comments>http://www.thinqlinq.com/Default/LINQ-Tools-coming-to-Russ-Tool-Shed.aspx</comments>
      <wfw:commentRss>http://www.thinqlinq.com/CommentRss.aspx?PostId=22064</wfw:commentRss>
      <wfw:comment>http://www.thinqlinq.com/Default/LINQ-Tools-coming-to-Russ-Tool-Shed.aspx</wfw:comment>
      <description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/rfustino/archive/2009/06/27/russ-tool-shed-presents-episode-3-it-s-all-about-the-tools-tv-show.aspx"&gt;Russ Fustino&lt;/a&gt; and Stan Schultes have recently started bringing their popular &lt;a href="http://www.russtoolshed.net/"&gt;Russ' Tool Shed&lt;/a&gt; show to the internet. If you want to check out the show, head on over to &lt;a href="http://channel9.msdn.com/shows/toolshed"&gt;http://channel9.msdn.com/shows/toolshed&lt;/a&gt;. They also have all of the resources, including source code, slides, and demo scripts available at &lt;a href="http://channel9.msdn.com/toolshed"&gt;http://channel9.msdn.com/toolshed&lt;/a&gt;. I was there when they recorded the first episode at the South Florida code camp as an attendee. &lt;/p&gt; &lt;p&gt;We're hoping to do a recording at one of the upcoming Florida Code Camps to look at LINQ related tools. I'm planning on covering the following tools. &lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://code.msdn.microsoft.com/csharpsamples"&gt;LINQ to SQL Visualizer&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="http://code.msdn.microsoft.com/csharpsamples"&gt;Expression Tree Visualizer&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://code.msdn.microsoft.com/csharpsamples"&gt;PasteXmlAsLinq&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.codeplex.com/i4o"&gt;i4o&lt;/a&gt; - Indexed LINQ to Objects&lt;/li&gt; &lt;li&gt;&lt;a href="http://linqtoxsd.codeplex.com/"&gt;LINQ to XSD&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://l2st4.codeplex.com/"&gt;L2ST4&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.linqpad.net/"&gt;LINQPad&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://linqtotwitter.codeplex.com/"&gt;LINQ to Twitter&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;All of these tools are free (a requirement of the Code Camp manifesto). I may add a couple tools, but only have 10 minutes to cover everything. Let me know if you have a favorite tool that's not on this list.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=X4PWIhow3cQ:Mdk6KOahjrk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=X4PWIhow3cQ:Mdk6KOahjrk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=X4PWIhow3cQ:Mdk6KOahjrk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=X4PWIhow3cQ:Mdk6KOahjrk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=X4PWIhow3cQ:Mdk6KOahjrk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=X4PWIhow3cQ:Mdk6KOahjrk:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=X4PWIhow3cQ:Mdk6KOahjrk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=X4PWIhow3cQ:Mdk6KOahjrk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=X4PWIhow3cQ:Mdk6KOahjrk:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=X4PWIhow3cQ:Mdk6KOahjrk:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/thinqlinq/rss/~4/X4PWIhow3cQ" height="1" width="1"/&gt;</description>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=1">LINQ</category>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=2">Code Camp</category>
    <feedburner:origLink>http://www.thinqlinq.com/Default/LINQ-Tools-coming-to-Russ-Tool-Shed.aspx</feedburner:origLink></item>
    <item>
      <title>LINQ in Action XML samples added to LINQPad</title>
      <link>http://feedproxy.google.com/~r/thinqlinq/rss/~3/jJo74QjVcNE/LINQ-in-Action-XML-samples-added-to-LINQPad.aspx</link>
      <pubDate>Sun, 28 Jun 2009 14:03:00 GMT</pubDate>
      <guid isPermaLink="false">42f563c8-34ea-4d01-bfe1-2047c2222a74:22063</guid>
      <dc:creator>jwooley</dc:creator>
      <slash:comments>2</slash:comments>
      <comments>http://www.thinqlinq.com/Default/LINQ-in-Action-XML-samples-added-to-LINQPad.aspx</comments>
      <wfw:commentRss>http://www.thinqlinq.com/CommentRss.aspx?PostId=22063</wfw:commentRss>
      <wfw:comment>http://www.thinqlinq.com/Default/LINQ-in-Action-XML-samples-added-to-LINQPad.aspx</wfw:comment>
      <description>&lt;p&gt;The beginning of this month, we released the samples from "&lt;a href="http://www.LinqInAction.net" target="_blank"&gt;LINQ in Action&lt;/a&gt;" for chapters 1-8 which covers LINQ to Objects, LINQ to SQL, and the new Language features. We're happy to announce that the next three chapters covering LINQ to XML are now available. That's over 70 new samples in VB and C# each. Follow the directions on the &lt;a href="http://www.thinqlinq.com/Default/LINQ-In-Action-Samples-available-in-LINQPad.aspx" target="_blank"&gt;original announcement&lt;/a&gt; to download and use these samples.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=jJo74QjVcNE:DE7ddRv4GB4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=jJo74QjVcNE:DE7ddRv4GB4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=jJo74QjVcNE:DE7ddRv4GB4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=jJo74QjVcNE:DE7ddRv4GB4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=jJo74QjVcNE:DE7ddRv4GB4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=jJo74QjVcNE:DE7ddRv4GB4:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=jJo74QjVcNE:DE7ddRv4GB4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=jJo74QjVcNE:DE7ddRv4GB4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/thinqlinq/rss?a=jJo74QjVcNE:DE7ddRv4GB4:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/thinqlinq/rss?i=jJo74QjVcNE:DE7ddRv4GB4:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/thinqlinq/rss/~4/jJo74QjVcNE" height="1" width="1"/&gt;</description>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=18">Linq to XML</category>
      <category domain="http://www.thinqlinq.com/Default.aspx?CategoryId=17">LinqPad</category>
    <feedburner:origLink>http://www.thinqlinq.com/Default/LINQ-in-Action-XML-samples-added-to-LINQPad.aspx</feedburner:origLink></item>
  </channel>
</rss>
