<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://linqinaction.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>LINQ in Action - THE LINQ book</title><link>http://linqinaction.net/blogs/default.aspx</link><description>Learn about the LINQ in Action book and the LINQ technology:&lt;br/&gt;LINQ to Objects, LINQ to SQL (DLINQ), LINQ to XML (XLINQ) and more...</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>LINQ or Lync?</title><link>http://linqinaction.net/blogs/main/archive/2010/10/02/linq-or-lync.aspx</link><pubDate>Fri, 01 Oct 2010 22:11:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4991</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;There's a new "link" from Redmond. It's not LINQ this time, but &lt;a href="http://www.microsoft.com/en-us/lync/"&gt;Lync&lt;/a&gt;.&lt;br&gt;Isn't it great to have two names colliding in the Microsoft world?&lt;/p&gt;&lt;p&gt;Is someone working on LINQ to Lync?&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4991" width="1" height="1"&gt;</description></item><item><title>Object databases for .NET with LINQ support</title><link>http://linqinaction.net/blogs/main/archive/2010/09/30/object-databases-dotnet-linq-support.aspx</link><pubDate>Wed, 29 Sep 2010 21:52:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4989</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;More and more database management systems offer built-in support for LINQ.&lt;/p&gt;&lt;p&gt;I've just tested some lightweight object database engines for .NET. See &lt;a href="http://weblogs.asp.net/fmarguerie/archive/2010/09/29/object-databases-for-dotnet-eloquera-stsdb-siaqodb-ninja.aspx"&gt;this post&lt;/a&gt; on my blog.&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4989" width="1" height="1"&gt;</description></item><item><title>LINQ in Action now in Chinese</title><link>http://linqinaction.net/blogs/jwooley/archive/2010/07/10/linq-in-action-now-in-chinese.aspx</link><pubDate>Sat, 10 Jul 2010 19:24:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4960</guid><dc:creator>jwooley</dc:creator><slash:comments>1</slash:comments><description>&lt;A title="Book Cover" href="http://www.ptpress.com.cn/Book.aspx?id=16848"&gt;&lt;IMG style="WIDTH:120px;HEIGHT:151px;" title="Linq in Action in Chinese" alt="Linq in Action in Chinese" align=left src="http://www.ptpress.com.cn/books/Covers/20851.jpg" width=120 height=151&gt;&lt;/A&gt;Today, I received an unexpected surprise in the mail. A copy of &lt;A title="LINQ in Action in Chinese" href="http://www.ptpress.com.cn/Book.aspx?id=16848"&gt;LINQ in Action translated into Chinese&lt;/A&gt;. We were aware that someone was making&amp;nbsp;a Chinese translation, but only expected it to be a couple chapters. It turns out the entire book, including the bonus chapter 14 (LINQ to Datasets) which didn't make the printed English version of the book. Hopefully nothing got lost in translation for this version. If you read Chinese, check the book out and let us know what you Thinq.&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4960" width="1" height="1"&gt;</description></item><item><title>Hex Dump using LINQ (in 7 lines of code)</title><link>http://linqinaction.net/blogs/main/archive/2010/03/12/hex-dump-using-linq-in-7-lines-of-code.aspx</link><pubDate>Fri, 12 Mar 2010 19:34:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4930</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;Eric White has posted &lt;a href="http://blogs.msdn.com/ericwhite/archive/2010/03/12/hex-dump-using-linq-in-7-lines-of-code.aspx"&gt;an interesting LINQ query on his blog that shows how to create a Hex Dump in something like 7 lines of code&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Of course, this is not production grade code, but it's another good example that demonstrates the expressiveness of LINQ.&lt;/p&gt;&lt;p&gt;Here is the code:&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:'Courier New';color:blue;font-size:small;"&gt;byte&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;[] ba = &lt;span&gt;File&lt;/span&gt;.ReadAllBytes(&lt;span&gt;"test.xml"&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span style="font-family:'Courier New';color:blue;font-size:small;"&gt;int&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt; bytesPerLine = 
16;&lt;/span&gt;&lt;br&gt;&lt;span style="font-family:'Courier New';color:blue;font-size:small;"&gt;string&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt; hexDump = ba.Select((c, i) =&amp;gt; &lt;span style="color:blue;"&gt;new&lt;/span&gt; { Char = c, Chunk = i / bytesPerLine })&lt;/span&gt;&lt;br&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
 &lt;/span&gt;.GroupBy(c =&amp;gt; c.Chunk)&lt;/span&gt;&lt;br&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;.Select(g 
=&amp;gt; g.Select(c =&amp;gt; &lt;span&gt;String&lt;/span&gt;.Format(&lt;span&gt;"{0:X2} "&lt;/span&gt;, c.Char))&lt;/span&gt;&lt;br&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
 &lt;/span&gt;.Aggregate((s, i) =&amp;gt; s + i))&lt;/span&gt;&lt;br&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
 &lt;/span&gt;.Select((s, i) =&amp;gt; &lt;span&gt;String&lt;/span&gt;.Format(&lt;span&gt;"{0:d6}: {1}"&lt;/span&gt;, i * 
bytesPerLine, s))&lt;/span&gt;&lt;br&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;.Aggregate(&lt;span&gt;""&lt;/span&gt;, (s, i) =&amp;gt; s + i + &lt;span&gt;Environment&lt;/span&gt;.NewLine);&lt;/span&gt;&lt;br&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;Console&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;.WriteLine(hexDump);&lt;/span&gt; &lt;br&gt;&lt;/p&gt;&lt;p&gt;Here is a sample output:&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;000000: FF 
FE 3C 00 3F 00 78 00 6D 00 6C 00 20 00 76 00&lt;/span&gt;&lt;br&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;000016: 65 00 72 
00 73 00 69 00 6F 00 6E 00 3D 00 22 00&lt;/span&gt;&lt;br&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;000032: 31 00 2E 
00 30 00 22 00 20 00 65 00 6E 00 63 00&lt;/span&gt;&lt;br&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;000048: 6F 00 64 
00 69 00 6E 00 67 00 3D 00 22 00 75 00&lt;/span&gt;&lt;br&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:small;"&gt;000064: 3E 00&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Eric White reports that he typically notices that declarative code is only 20% as long as imperative code.&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4930" width="1" height="1"&gt;</description></item><item><title>LINQ to CSV using DynamicObject</title><link>http://linqinaction.net/blogs/jwooley/archive/2009/11/22/linq-to-csv-using-dynamicobject.aspx</link><pubDate>Sun, 22 Nov 2009 17:31:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4905</guid><dc:creator>jwooley</dc:creator><slash:comments>3</slash:comments><description>&lt;P&gt;When we wrote &lt;A href="http://linqinaction.net/"&gt;&lt;FONT color=#669966&gt;LINQ in Action&lt;/FONT&gt;&lt;/A&gt; we included a sample of how to simply query against a CSV file using the following LINQ query:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=vbasic&gt;
From line In File.ReadAllLines(“books.csv”) 
Where Not Line.StartsWith(“#”) 
Let parts = line.Split(“,”c) 
Select Isbn = parts(0), Title = parts(1), Publisher = parts(3)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;While this code does make dealing with CSV easier, it would be nicer if we could refer to our columns as if they were properties where the property name came from the header row in the CSV file, perhaps using syntax like the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=vbasic&gt;
From line In MyCsvFile
Select line.Isbn, line.Title, line.Publisher
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;With strongly typed (compile time) structures, it is challenging to do this when dealing with variable data structures like CSV files. One of the big enhancements that is coming with .Net 4.0 is the inclusion of Dynamic language features, including the new DynamicObject data type. In the past, working with dynamic runtime structures, we were limited to using reflection tricks to access properties that didn't actually exist. The addition of dynamic language constructs offers better ways of dispatching the call request over dynamic types. Let's see what we need to do to expose a CSV row using the new dynamic features in Visual Studio 2010.&lt;/P&gt;
&lt;P&gt;First, let's create an object that will represent each row that we are reading. This class will inherit from the new System.Dynamic.DynamicObject base class. This will set up the base functionality to handle the dynamic dispatching for us. All we need to do is add implementation to tell the object how to fetch values based on a supplied field name. We'll implement this by taking a string representing the current row. We'll split that based on the separator (a comma). We also supply a dictionary containing the field names and their index. Given these two pieces of information, we can override the TryGetMember and TrySetMember to Get and Set the property based on the field name:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=vbasic&gt;
Imports System.Dynamic

Public Class DynamicCsv
    Inherits DynamicObject

    Private _fieldIndex As Dictionary(Of String, Integer)
    Private _RowValues() As String

    Friend Sub New(ByVal currentRow As String,
                   ByVal fieldIndex As Dictionary(Of String, Integer))
        _RowValues = currentRow.Split(","c)
        _fieldIndex = fieldIndex
    End Sub

    Public Overrides Function TryGetMember(ByVal binder As GetMemberBinder,
                                           ByRef result As Object) As Boolean
        If _fieldIndex.ContainsKey(binder.Name) Then
            result = _RowValues(_fieldIndex(binder.Name))
            Return True
        End If
        Return False
    End Function

    Public Overrides Function TrySetMember(ByVal binder As SetMemberBinder,
                                           ByVal value As Object) As Boolean
        If _fieldIndex.ContainsKey(binder.Name) Then
            _RowValues(_fieldIndex(binder.Name)) = value.ToString
            Return True
        End If
        Return False
    End Function
End Class
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;With this in place, now we just need to add a class to handle iterating over the individual rows in our CSV file. As we pointed out in our book, using File.ReadAllLines can be a significant performance bottleneck for large files. Instead we will implement a custom Enumerator. In our customer enumerable, we initialize the process with the GetEnumerator method. This method opens the stream based on the supplied filename. It also sets up our dictionary of field names based on the values in the first row. Because we keep the stream open through the lifetime of this class, we implement IDisposable to clean up the stream.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;As we iterate over the results calling MoveNext, we will read each subsequent row and create a DynamicCsv instance object. We return this row as an Object (Dynamic in C#) so that we will be able to consume it as a dynamic type in .Net 4.0. Here's the implementation: 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=vbasic&gt;
Imports System.Collections

Public Class DynamicCsvEnumerator
    Implements IEnumerator(Of Object)
    Implements IEnumerable(Of Object)

    Private _FileStream As IO.TextReader
    Private _FieldNames As Dictionary(Of String, Integer)
    Private _CurrentRow As DynamicCsv
    Private _filename As String

    Public Sub New(ByVal fileName As String)
        _filename = fileName
    End Sub

    Public Function GetEnumerator() As IEnumerator(Of Object) _
        Implements IEnumerable(Of Object).GetEnumerator

        _FileStream = New IO.StreamReader(_filename)
        Dim headerRow = _FileStream.ReadLine
        Dim fields = headerRow.Split(","c)
        _FieldNames = New Dictionary(Of String, Integer)
        For i = 0 To fields.Length - 1
            _FieldNames.Add(GetSafeFieldName(fields(i)), i)
        Next
        _CurrentRow = New DynamicCsv(_FileStream.ReadLine, _FieldNames)

        Return Me
    End Function

    Function GetSafeFieldName(ByVal input As String) As String
        Return input.Replace(" ", "_")
    End Function

    Public Function GetEnumerator1() As IEnumerator Implements IEnumerable.GetEnumerator
        Return GetEnumerator()
    End Function

    Public ReadOnly Property Current As Object Implements IEnumerator(Of Object).Current
        Get
            Return _CurrentRow
        End Get
    End Property

    Public ReadOnly Property Current1 As Object Implements IEnumerator.Current
        Get
            Return Current
        End Get
    End Property

    Public Function MoveNext() As Boolean Implements IEnumerator.MoveNext
        Dim line = _FileStream.ReadLine
        If line IsNot Nothing AndAlso line.Length &amp;gt; 0 Then
            _CurrentRow = New DynamicCsv(line, _FieldNames)
            Return True
        Else
            Return False
        End If
    End Function

    Public Sub Reset() Implements IEnumerator.Reset
        _FileStream.Close()
        GetEnumerator()
    End Sub

#Region "IDisposable Support"
    Private disposedValue As Boolean ' To detect redundant calls

    ' IDisposable
    Protected Overridable Sub Dispose(ByVal disposing As Boolean)
        If Not Me.disposedValue Then
            If disposing Then
                _FileStream.Dispose()
            End If
            _CurrentRow = Nothing
        End If
        Me.disposedValue = True
    End Sub

    ' This code added by Visual Basic to correctly implement the disposable pattern.
    Public Sub Dispose() Implements IDisposable.Dispose
        Dispose(True)
        GC.SuppressFinalize(Me)
    End Sub
#End Region

End Class

&lt;/CODE&gt;&lt;/PRE&gt;Now that we have our custom enumerable, we can consume it using standard dot notation by turning Option Strict Off in Visual Basic or referencing it as a Dynamic type in C#: 
&lt;H3&gt;VB:&lt;/H3&gt;&lt;PRE&gt;&lt;CODE class=vbasic&gt;

Public Sub OpenCsv()
    Dim data = New DynamicCsvEnumerator("C:\temp\Customers.csv")
    For Each item In data
        TestContext.WriteLine(item.CompanyName &amp;amp; ": " &amp;amp; item.Contact_Name)
    Next

End Sub
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;H3&gt;C#:&lt;/H3&gt;&lt;PRE&gt;&lt;CODE class=csharp&gt;
[TestMethod]
public void OpenCsvSharp()
{
    var data = new DynamicCsvEnumerator(@"C:\temp\customers.csv");
    foreach (dynamic item in data)
    {
        TestContext.WriteLine(item.CompanyName + ": " + item.Contact_Name);
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In addition, since we are exposing this as an IEnumerable, we can use all of the same LINQ operators over our custom class:&lt;/P&gt;
&lt;H3&gt;VB:&lt;/H3&gt;&lt;PRE&gt;&lt;CODE class=vbasic&gt;
Dim query = From c In data
            Where c.City = "London"
            Order By c.CompanyName
            Select c.Contact_Name, c.CompanyName

For Each item In query
    TestContext.WriteLine(item.CompanyName &amp;amp; ": " &amp;amp; item.Contact_Name)
Next
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;H3&gt;C#:&lt;/H3&gt;&lt;PRE&gt;&lt;CODE class=csharp&gt;
[TestMethod]
public void LinqCsvSharp()
{
    var data = new DynamicCsvEnumerator(@"C:\temp\customers.csv");
    var query = from dynamic c in data 
                where c.City == "London"
                orderby c.CompanyName
                select new { c.Contact_Name, c.CompanyName };

    foreach (var item in query)
    {
        TestContext.WriteLine(item.CompanyName + ": " + item.Contact_Name);
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note: This sample makes a couple assumptions about the underlying data and implementation. First, we take an extra step to translate header strings that contain spaces to replace the space with an underscore. While including spaces is legal in the csv header, it isn't legal in VB to say: " MyObject.Some Property With Spaces". Thus we'll manage this by requiring the code to access this property as follows: "MyObject.Some_Property&#x1F;_With_Spaces".&lt;/P&gt;
&lt;P&gt;Second, this implementation doesn't handle strings that contain commas. Typically fields in CSV files that contain commas are wrapped by quotes (subsequently quotes are likewise escaped by double quotes). This implementation does not account for either situation. I purposely did not incorporate those details in order to focus on the use of DynamicObject in this sample. I welcome enhancement suggestions to make this more robust.&lt;/P&gt;
&lt;P&gt;Crossposted from &lt;A title=ThinqLinq.Com href="http://www.thinqlinq.com/Post.aspx/Title/LINQ-to-CSV-using-DynamicObject"&gt;ThinqLinq.com&lt;/A&gt;&lt;/P&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4905" width="1" height="1"&gt;</description><category domain="http://linqinaction.net/blogs/jwooley/archive/tags/CSV+LINQ/default.aspx">CSV LINQ</category></item><item><title>New LINQ tools category on SharpToolbox.com</title><link>http://linqinaction.net/blogs/main/archive/2009/10/03/new-linq-tools-category-on-sharptoolbox-com.aspx</link><pubDate>Sat, 03 Oct 2009 12:55:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4886</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I've just moved the LINQ tools referenced on SharpToolbox.com to a new &lt;a href="http://SharpToolbox.com/categories/linq"&gt;dedicated LINQ category&lt;/a&gt;.&lt;br&gt;20 tools and providers are listed for the moment. I'll add more shortly.&lt;/p&gt;&lt;p&gt;See &lt;a href="http://www.thinqlinq.com/Post.aspx/PostId/22076"&gt;Jim's blog&lt;/a&gt; for more resources.&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4886" width="1" height="1"&gt;</description></item><item><title>LINQ in Action is now available in Chinese (LINQ实战) and in English in India</title><link>http://linqinaction.net/blogs/main/archive/2009/07/22/linq-chinese-india.aspx</link><pubDate>Wed, 22 Jul 2009 18:54:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4847</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;After English, &lt;a href="http://linqinaction.net/blogs/main/archive/2008/08/28/linq-im-einsatz-linq-in-action-in-german.aspx"&gt;German&lt;/a&gt;, &lt;a href="http://linqinaction.net/blogs/main/archive/2009/04/17/linq-in-action-in-spanish.aspx"&gt;Spanish&lt;/a&gt;, and &lt;a href="http://linqinaction.net/blogs/main/archive/2009/05/20/linq-em-a-o-linq-in-action-in-portuguese.aspx"&gt;Portuguese&lt;/a&gt;, &lt;a href="http://linqinaction.net"&gt;LINQ in Action&lt;/a&gt; is now available in &lt;b&gt;Chinese (中文)&lt;/b&gt;.&lt;/p&gt;&lt;p&gt;The title is &lt;b&gt;LINQ实战&lt;/b&gt;. The publisher is &lt;a href="http://www.ptpress.com.cn/Book.aspx?id=16848"&gt;人民邮电出版社&lt;/a&gt; (Posts &amp;amp; Telecom Press). The book is also available on &lt;a href="http://www.amazon.cn/mn/detailApp?prodid=bkbk907926"&gt;Amazon.cn/joyo&lt;/a&gt; and several other bookstores.&lt;/p&gt;&lt;p&gt;In addition to all the translations, LINQ in Action has been &lt;a href="http://www.dreamtechpress.com/display.asp?isbn=978-81-7722-882-3"&gt;republished in English in &lt;b&gt;India&lt;/b&gt; by DreamTech Press&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4847" width="1" height="1"&gt;</description></item><item><title>LINQ in Action XML samples now in LINQPad too</title><link>http://linqinaction.net/blogs/main/archive/2009/06/28/linq-in-action-xml-samples-now-in-linqpad-too.aspx</link><pubDate>Sun, 28 Jun 2009 18:58:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4825</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;After &lt;a href="http://linqinaction.net/blogs/main/archive/2009/06/06/linq-in-action-samples-in-linqpad.aspx"&gt;we published the code samples for LINQ in Action's first chapters in LINQPad&lt;/a&gt; a few weeks ago, the samples of three more chapters have just been added. These chapters cover LINQ to XML. Thanks &lt;a href="http://www.thinqlinq.com/Default/LINQ-in-Action-XML-samples-added-to-LINQPad.aspx"&gt;Jim&lt;/a&gt; for doing the additional conversion.&lt;br&gt;&lt;/p&gt;&lt;p&gt;The code samples for chapters 1 to 11 are now available. Read &lt;a href="http://linqinaction.net/blogs/main/archive/2009/06/06/linq-in-action-samples-in-linqpad.aspx"&gt;the original announcement&lt;/a&gt; to learn how to download and use these samples. A new download is enough to get the update.&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4825" width="1" height="1"&gt;</description></item><item><title>LINQ in Action samples in LINQPad</title><link>http://linqinaction.net/blogs/main/archive/2009/06/06/linq-in-action-samples-in-linqpad.aspx</link><pubDate>Sat, 06 Jun 2009 11:12:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4808</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>3</slash:comments><description>&lt;a href="http://linqpad.net"&gt;&lt;img src="http://linqinaction.net/photos/main/images/4804/original.aspx" title="LINQPad logo" alt="LINQPad logo" style="float:right;margin-left:5px;margin-bottom:5px;" width="150" border="0" height="144"&gt;&lt;/a&gt;

&lt;p&gt;Do you know &lt;a href="http://linqpad.net/"&gt;LINQPad&lt;/a&gt;? It's a really simple but great tool for testing LINQ queries. Not only that, but it can be used to test all kinds of C# and VB code snippets.&lt;/p&gt;

&lt;p&gt;Another great thing about LINQPad is that it comes with code samples. Until now the integrated code samples came from the &lt;a href="http://www.albahari.com/nutshell/"&gt;C# 3.0 in a Nutshell&lt;/a&gt; book. Joe Albahari, author of LINQPad and C# 3.0 in a Nutshell, has opened LINQPad so that code samples from other books can be integrated into LINQPad. Thanks Joe for this opportunity!&lt;/p&gt;

&lt;p&gt;We worked with Joe to integrate LINQ in Action's code samples into LINQPad. The result is that in addition to being &lt;a href="http://linqinaction.net/files/folders/linqinaction/entry1952.aspx"&gt;available as Visual Studio solutions and projects&lt;/a&gt;, you can now run our code samples directly from LINQPad. This makes it very easy to explore LINQ's features with instant "code and play".&lt;/p&gt;

&lt;p&gt;To install LINQ in Action's code samples in LINQPad, all you have to do is click on the "Download more samples..." link:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://linqinaction.net/photos/main/images/4805/original.aspx" width="587" height="294"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;You'll see LINQ in Action proposed as one of the LINQPad-enabled books (the only one at the moment, in fact):&lt;/p&gt;
&lt;p&gt;&lt;img src="http://linqinaction.net/photos/main/images/4806/original.aspx" width="500" height="355"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;Once you've clicked on "Download full code listings into LINQPad", you should see the C# and VB samples grouped by chapter:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://linqinaction.net/photos/main/images/4807/original.aspx"&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;Currently, chapters 1 to 8 are available. We'll integrate the remaining code samples soon.&lt;/p&gt;

&lt;p&gt;Have fun with LINQ! &lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4808" width="1" height="1"&gt;</description></item><item><title>ForEach debate continued</title><link>http://linqinaction.net/blogs/main/archive/2009/05/21/foreach-debate-continued.aspx</link><pubDate>Thu, 21 May 2009 08:04:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4798</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/ericlippert"&gt;Eric Lippert&lt;/a&gt;, whose blog you shouldn't miss, adds his own arguments to &lt;a href="http://linqinaction.net/blogs/main/archive/2009/02/25/foreach-or-not-foreach-that-is-the-question.aspx"&gt;the debate&lt;/a&gt; about whether using a &lt;i&gt;ForEach&lt;/i&gt; extension method instead of &lt;i&gt;foreach&lt;/i&gt; is a good idea or a bad one.&lt;/p&gt;&lt;p&gt;I don't see a definitive answer to the question. All the arguments given here and elsewhere are good, but in the end, it's up to you to decide what you prefer to do.&lt;br&gt;Read the posts and the comments to make up your own mind.&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4798" width="1" height="1"&gt;</description></item><item><title>LINQ em Ação, LINQ in Action in Portuguese</title><link>http://linqinaction.net/blogs/main/archive/2009/05/20/linq-em-a-o-linq-in-action-in-portuguese.aspx</link><pubDate>Wed, 20 May 2009 12:03:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4793</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;&lt;a href="http://www.lcm.com.br/index.php?Escolha=20&amp;amp;Livro=L00714"&gt;&lt;img src="http://linqinaction.net/photos/main/images/4792/original.aspx" title="LINQ em Ação" alt="LINQ em Ação" width="216" align="right" border="0" height="303" hspace="5"&gt;&lt;/a&gt;After English, &lt;a href="http://linqinaction.net/blogs/main/archive/2008/08/28/linq-im-einsatz-linq-in-action-in-german.aspx"&gt;German&lt;/a&gt; and &lt;a href="http://linqinaction.net/blogs/main/archive/2009/04/17/linq-in-action-in-spanish.aspx"&gt;Spanish&lt;/a&gt;, &lt;a href="http://linqinaction.net"&gt;LINQ in Action&lt;/a&gt; is now available &lt;span style="font-style:italic;"&gt;em Português&lt;/span&gt;.&lt;/p&gt;&lt;p&gt;The title is &lt;a href="http://www.lcm.com.br/index.php?Escolha=20&amp;amp;Livro=L00714"&gt;LINQ em Ação&lt;/a&gt;. The publisher is &lt;a href="http://www.lcm.com.br"&gt;Editora Ciência Moderna&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4793" width="1" height="1"&gt;</description></item><item><title>LINQ in Action in Spanish</title><link>http://linqinaction.net/blogs/main/archive/2009/04/17/linq-in-action-in-spanish.aspx</link><pubDate>Thu, 16 Apr 2009 21:44:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4742</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>7</slash:comments><description>&lt;p&gt;Today I had the pleasure to receive a copy of &lt;a href="http://linqinaction.net"&gt;LINQ in Action&lt;/a&gt; translated in Spanish. This came a bit unexpected, but it's great!&lt;/p&gt;&lt;p&gt;LINQ in Action already existed &lt;a href="http://linqinaction.net/blogs/main/archive/2008/08/28/linq-im-einsatz-linq-in-action-in-german.aspx"&gt;in German (LINQ im Einsatz)&lt;/a&gt;, and I know that other translations should be published soon. The Chinese version is the next one expected, I believe.&lt;/p&gt;&lt;p&gt;The Spanish version of the book is published by &lt;a href="http://www.anayamultimedia.es"&gt;Anaya Multimedia&lt;/a&gt;. The title of the book is simply... "LINQ"!&lt;/p&gt;&lt;p&gt;¡Espero que disfruten la lectura de este libro!&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4742" width="1" height="1"&gt;</description></item><item><title>LINQ Deep Dive: great LINQ tips</title><link>http://linqinaction.net/blogs/main/archive/2009/04/03/linq-deep-dive-great-linq-tips.aspx</link><pubDate>Fri, 03 Apr 2009 07:50:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4736</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://weblogs.asp.net/zeeshanhirani/"&gt;Zeeshan Hirani&lt;/a&gt; who already offered us &lt;a href="http://weblogs.asp.net/zeeshanhirani/archive/2008/12/18/my-christmas-present-to-the-entity-framework-community.aspx"&gt;a 500-page Entity Framework learning guide&lt;/a&gt;, now publishes &lt;a href="http://www.aspnetpro.com/articles/2009/04/asp200904zh_f/asp200904zh_f.asp"&gt;great LINQ tips in the first part of his LINQ Deep Dive articles&lt;/a&gt;. These tips are not the usual introductions to LINQ features you can find elsewhere. You can tell that they come from someone who lives in the trenches. I learnt very interesting features and best practices I didn't know about. &lt;/p&gt;&lt;ol&gt;&lt;li&gt;Apply filters before a join to improve query performance&lt;/li&gt;&lt;li&gt;Filter LINQ queries using object reference comparison&lt;/li&gt;&lt;li&gt;Apply aggregates to empty collections in LINQ to SQL queries&lt;/li&gt;&lt;li&gt;Delay loading a property in LINQ to SQL&lt;/li&gt;&lt;li&gt;Use table-valued functions with eager loading turned on&lt;/li&gt;&lt;li&gt;Put joins in the correct order in a LINQ to Objects query&lt;/li&gt;&lt;li&gt;Compose a LINQ query inside a loop&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;a href="http://www.aspnetpro.com/articles/2009/04/asp200904zh_f/asp200904zh_f.asp"&gt;LINQ Deep Dive: Part I, Tips for Delving in to LINQ&lt;/a&gt;&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4736" width="1" height="1"&gt;</description></item><item><title>ForEach or not ForEach, that is the question</title><link>http://linqinaction.net/blogs/main/archive/2009/02/25/foreach-or-not-foreach-that-is-the-question.aspx</link><pubDate>Wed, 25 Feb 2009 16:19:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4715</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>2</slash:comments><description>
&lt;p&gt;In &lt;a href="http://www.amazon.com/gp/product/1933988169?ie=UTF8&amp;amp;tag=sharptoolbox-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1933988169"&gt;LINQ in Action&lt;/a&gt;, we discuss about the missing &lt;b&gt;ForEach&lt;/b&gt; query operator. This is in Chapter 5 "Beyond basic in-memory queries", more precisely in section 5.2.2. There, we indicate that &lt;a href="http://blogs.msdn.com/ericwhite"&gt;Eric White&lt;/a&gt; suggested this operator in &lt;a href="http://blogs.msdn.com/ericwhite/pages/FP-Tutorial.aspx"&gt;his functional programming tutorial&lt;/a&gt;, although I'm not able to find the exact reference at the moment in this tutorial.&lt;/p&gt;
&lt;p&gt;Since then, a lot of people have been asking for ForEach. &lt;a href="http://blogs.msdn.com/kirillosenkov/archive/2009/01/31/foreach.aspx"&gt;This can be seen on Kirill Osenkov's blog&lt;/a&gt;, where you'll find links to discussions about whether ForEach is good or bad.&lt;br&gt;I don't know if we're going to see ForEach appear in .NET. Anyway, it's not very difficult to write your own:&lt;/p&gt;
&lt;p style="font-family:courier new;color:Navy;"&gt;public static void ForEach&amp;lt;T&amp;gt;(this IEnumerable&amp;lt;T&amp;gt; source, Action&amp;lt;T&amp;gt; action)&lt;br&gt;{&lt;br&gt;&amp;nbsp; if (source == null)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new ArgumentNullException("source");&lt;br&gt;&amp;nbsp; if (action == null)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new ArgumentNullException("action");&lt;br&gt;&lt;br&gt;&amp;nbsp; foreach (var item in source)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; action(item);&lt;br&gt;}&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4715" width="1" height="1"&gt;</description></item><item><title>Converting LINQ queries from query syntax to method/operator syntax</title><link>http://linqinaction.net/blogs/main/archive/2009/02/06/converting-linq-queries-from-query-syntax-to-method-operator-syntax.aspx</link><pubDate>Fri, 06 Feb 2009 15:05:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4701</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Yesterday a reader of the &lt;a href="http://linq-book.com"&gt;LINQ in Action book&lt;/a&gt; posted an &lt;a href="http://www.manning-sandbox.com/thread.jspa?messageID=81167"&gt;interesting challenge&lt;/a&gt; on &lt;a href="http://www.manning-sandbox.com/forum.jspa?forumID=302&amp;amp;start=0"&gt;the book's forum&lt;/a&gt;. It's interesting enough to be reposted it here.&lt;br&gt;&lt;/p&gt;

&lt;p&gt;The request was to convert a LINQ query expression (query syntax) to a query operator call chain (method syntax or dot notation). The original query was the following one:&lt;br&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p style="font-family:courier new;color:Navy;"&gt;from publisher in SampleData.Publishers&lt;br&gt;      join book in SampleData.Books on publisher equals book.Publisher into publisherBooks&lt;br&gt;      from book in publisherBooks.DefaultIfEmpty()&lt;br&gt;      select new&lt;br&gt;      {&lt;br&gt;&amp;nbsp; Publisher = publisher.Name,&lt;br&gt;&amp;nbsp; Book = book == default(Book) ? "(no books)" : book.Title&lt;br&gt;      };&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This query comes from LINQ in Action. In chapter 4 more precisely, where we cover grouping and joins.&lt;/p&gt;

&lt;p&gt;Converting LINQ queries is an interesting exercise because it's not always easy to find the solution but you learn a lot in the process. Often, you'll have to use "tricks". Here the tricks are based on the use of anonymous types. Side note: this is also what you'd use to translate the &lt;i&gt;let&lt;/i&gt; keyword.&lt;br&gt;&lt;br&gt;Here is the solution I gave:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p style="font-family:courier new;color:Navy;"&gt;SampleData.Publishers&lt;br&gt;&amp;nbsp; .GroupJoin(SampleData.Books,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; publisher =&amp;gt; publisher, book =&amp;gt; book.Publisher,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (publisher, publisherBooks) =&amp;gt; new { Publisher = publisher, PublisherBooks = publisherBooks })&lt;br&gt;&amp;nbsp; .SelectMany(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; group =&amp;gt; group.PublisherBooks.DefaultIfEmpty&amp;lt;Book&amp;gt;(),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (group, book) =&amp;gt; new {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Publisher = group.Publisher.Name,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Book = (book == null) ? "(no books)" : book.Title&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Not as easy to read as your original query, don't you think? See my previous post about &lt;a href="http://linqinaction.net/blogs/main/archive/2008/01/20/query-syntax-vs-method-syntax.aspx"&gt;Query syntax vs. Method syntax&lt;/a&gt; to decide which syntax is best for you.&lt;br&gt;&lt;br&gt;"How did he manage to convert the query," you may be wondering... Well, even if I know the tricks, the easiest is to use &lt;a href="http://www.red-gate.com/products/reflector/"&gt;.NET Reflector&lt;/a&gt; to decompile the IL.&lt;br&gt;If you specify ".NET 3.5" for the &lt;i&gt;Optimization&lt;/i&gt; option, you'll see the query expression. But if you specify ".NET 2.0", you'll see something that looks close to the above query. You'll have to replace the anonymous methods with lambda expressions and change the name of the anonymous parameters to make the code somewhat more readable, though.&lt;br&gt;&lt;br&gt;As usual, Reflector is your best friend. It reveals a lot of secrets ;-)&lt;/p&gt;
&lt;p&gt;&lt;span style="color:Green;font-weight:bold;"&gt;Update:&lt;/span&gt; Joe Albahari, of &lt;a href="http://www.linqpad.net/"&gt;LINQPad&lt;/a&gt; fame, suggested other solutions:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;1) Calling &lt;b&gt;.ToString()&lt;/b&gt; on the query's expression will work just fine if you add AsQueryable() to the first sequence: &lt;i&gt;from publisher in SampleData.Publishers&lt;b&gt;.AsQueryable()&lt;/b&gt; join book...&lt;/i&gt;&lt;br&gt;2) If you use LINQPad to run the query, you'll notice it shows lambda translations for all IQueryable-based queries. LINQPad uses its own expression visitor so the result is much more readable than simply calling ToString on the expression.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4701" width="1" height="1"&gt;</description></item><item><title>LINQ to SQL supported data types and functions</title><link>http://linqinaction.net/blogs/jwooley/archive/2009/01/21/linq-supported-data-types-and-functions.aspx</link><pubDate>Wed, 21 Jan 2009 09:02:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4656</guid><dc:creator>jwooley</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;When we were writing LINQ in Action, we weren't able to specify all of the possible methods and functions that&amp;nbsp;have supported LINQ to SQL query translations for a couple reasons. &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;There were too many to be included in the scope of the book. &lt;/li&gt;
&lt;li&gt;The book was being written at the same time that LINQ was evolving and more comprehensions were being supported, thus giving us a moving target that we couldn't ensure the accuracy of when the product shipped.&lt;/li&gt;
&lt;li&gt;We realized that over time, translations for more functions may be added and enumerating the list in the book might not reflect the current methods supported with a given framework version.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;As I was searching for an answer to a recent question, I happened upon&amp;nbsp;a listing on MSDN showing the functions and methods which are and are not supported. The full list of LINQ to SQL supported and unsupported members is available online at &lt;a href="http://msdn.microsoft.com/en-us/library/bb386970.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb386970.aspx&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;As an example the following methods are shown as having translations for &lt;a href="http://msdn.microsoft.com/en-us/library/bb882657.aspx"&gt;DateTime values&lt;/a&gt;: Add, Equals, CompareTo, Date, Day, Month, Year. In contrast methods like ToShortDateString, IsLeapYear, ToUniversalTime are not supported. &lt;/p&gt;
&lt;p&gt;If you need to use one of the unsupported methods, you need to force the results to the client and evaulate them using LINQ to Objects at that point. You can do that using the .AsEnumerable extension method at any point in the query comprehension. Any portion of the query that follows AsEnumerable will be evaluated on the client side.&lt;/p&gt;
&lt;p&gt;Crossposted from &lt;a href="http://www.thinqlinq.com/Default/LINQ-supported-data-types-and-functions.aspx"&gt;http://www.thinqlinq.com/Default/LINQ-supported-data-types-and-functions.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4656" width="1" height="1"&gt;</description><category domain="http://linqinaction.net/blogs/jwooley/archive/tags/LINQ/default.aspx">LINQ</category></item><item><title>IQToolkit, building your own LINQ IQueryable provider</title><link>http://linqinaction.net/blogs/main/archive/2008/11/23/iqtoolkit-building-your-own-linq-iqueryable-provider.aspx</link><pubDate>Sat, 22 Nov 2008 21:59:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4416</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>0</slash:comments><description>&lt;P&gt;Matt Warren, who provides &lt;A class="" href="http://blogs.msdn.com/mattwar/pages/linq-links.aspx"&gt;the most detailed&amp;nbsp;HOWTO for creating your own LINQ IQueryable provider&lt;/A&gt;, has now &lt;A class="" href="http://blogs.msdn.com/mattwar/archive/2008/11/21/linq-iqtoolkit-on-codeplex.aspx"&gt;published a dedicated toolkit on CodePlex&lt;/A&gt;:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;IQToolkit is essential if you are building your own LINQ IQueryable provider. It contains common tools and source code you can apply to your own project.&lt;BR&gt;In the toolkit you will find useful techniques for manipulating LINQ expression trees, implementing IQueryable providers, and a host of extensible components for building providers that target translation of LINQ expressions into SQL like languages.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://www.codeplex.com/IQToolkit"&gt;http://www.codeplex.com/IQToolkit&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Creating&amp;nbsp;a LINQ provider is not a walk in the park, but at least if you have to, you have everything you need at hand.&lt;/P&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4416" width="1" height="1"&gt;</description></item><item><title>Using the Select LINQ query operator with indexes</title><link>http://linqinaction.net/blogs/main/archive/2008/11/10/using-the-select-linq-query-operator-with-indexes.aspx</link><pubDate>Mon, 10 Nov 2008 17:59:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4358</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Yesterday, &lt;a href="http://linqinaction.net/blogs/main/archive/2008/09/25/speaking-at-devteach-montreal-in-december.aspx"&gt;Fred&lt;/a&gt; asked me if I could help him to convert C# code to LINQ. The solution may not obvious to find unless you know LINQ well. I will reproduce here the solution I gave Fred. Whether the LINQ version of the code is easier to read than the original one is arguable. The purpose here is more to show LINQ's &lt;i&gt;Select&lt;/i&gt; query operator in action.&lt;/p&gt;

&lt;p&gt;Here is the original code:&lt;/p&gt;

&lt;pre style="font-family:courier new;color:Navy;"&gt;int CountCorrectChars(string proposedValue, string correctValue)&lt;br&gt;{&lt;br&gt;&amp;nbsp; int correctCount = 0;&lt;br&gt;&amp;nbsp; for (int i = 0; i &amp;lt; proposedValue.Length &amp;amp;&amp;amp; i &amp;lt; correctValue.Length; i++)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (proposedValue[&lt;b&gt;&lt;/b&gt;i] == correctValue[&lt;b&gt;&lt;/b&gt;i])&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; correctCount++;&lt;br&gt;&amp;nbsp; return correctCount;&lt;br&gt;}&lt;/pre&gt;

&lt;p&gt;Here is the LINQ version that I suggested:&lt;br&gt;&lt;/p&gt;

&lt;pre style="font-family:courier new;color:Navy;"&gt;int CountCorrectChars(string proposedValue, string correctValue)&lt;br&gt;{&amp;nbsp;&amp;nbsp;&lt;br&gt;  return correctValue&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Select((testChar, index) =&amp;gt; new { Character = testChar, Index = index })&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Count(testChar =&amp;gt; (testChar.Index &amp;lt; proposedValue.Length)&lt;br&gt;        &amp;amp;&amp;amp; (testChar.Character  == proposedValue[testChar.Index]));&lt;br&gt;}&lt;/pre&gt;

&lt;p&gt;As you can see, the LINQ version is not so easy to understand and is verbose. Of course, we could use shorter names, but that wouldn't change the complexity of the query. The LINQ version is not as good in terms of performance either... So, should we use LINQ or not? My point here is that LINQ is not a "one size fits all" solution. You should use it wisely and avoid complexifying code by choosing always to use LINQ.&lt;/p&gt;

&lt;p&gt;What's interesting in this example, is also simply the use of &lt;i&gt;Select&lt;/i&gt; with a two-parameter lambda expression. You may know the version of Select that takes a single-parameter lambda well, but its counterpart is less known (and used).&lt;/p&gt;

&lt;p&gt;This is something that we cover in &lt;a href="http://linq-book.com"&gt;LINQ in Action&lt;/a&gt; in section 4.4.2. Here is what we write there, which gives another example of &lt;i&gt;Select&lt;/i&gt; in action:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;i&gt;Select&lt;/i&gt; and &lt;i&gt;SelectMany&lt;/i&gt; operators can be used to retrieve the index of each element in a sequence. Let’s say we want to display the index of each book in our collection before we sort them in alphabetical order:&lt;br&gt;&lt;/p&gt;
&lt;div style="color:Navy;"&gt;index=3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title=All your base are belong to us&lt;br&gt;index=4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title=Bonjour mon Amour&lt;br&gt;index=2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title=C# on Rails&lt;br&gt;index=0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title=Funny Stories&lt;br&gt;index=1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title=LINQ rules&lt;/div&gt;&lt;br&gt;Here is how to use &lt;i&gt;Select&lt;/i&gt; to achieve that:&lt;br&gt;
&lt;br&gt;
Listing 4.15&amp;nbsp;&amp;nbsp;&amp;nbsp; Code-behind for the first ASP.NET page&amp;nbsp;&amp;nbsp;&amp;nbsp; (SelectIndex.csproj)&lt;br&gt;&lt;div style="font-family:courier new;color:Navy;"&gt;var books =&lt;br&gt;&amp;nbsp; SampleData.Books&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Select((book, index) =&amp;gt; new { index, book.Title })&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .OrderBy(book =&amp;gt; book.Title);&lt;br&gt;ObjectDumper.Write(books);&lt;/div&gt;&lt;br&gt;This time we can’t use the query expression syntax because the variant of the &lt;i&gt;Select&lt;/i&gt; operator that provides the index has no equivalent in this syntax. Notice that this version of the &lt;i&gt;Select&lt;/i&gt; method provides an &lt;i&gt;index&lt;/i&gt; variable that we can use in our lambda expression &lt;span style="color:Navy;"&gt;(precision not in the book: its not the name "index" that is important. You can use another name if you want. What makes the difference is that the lambda expression takes two parameters)&lt;/span&gt;. The compiler automatically determines which version of the &lt;i&gt;Select&lt;/i&gt; operator we want to use just by looking at the presence or absence of the &lt;i&gt;index&lt;/i&gt; parameter. Notice also that we call &lt;i&gt;Select&lt;/i&gt; before &lt;i&gt;OrderBy&lt;/i&gt;. This is important to get the indices before the books are sorted, not after. &lt;br&gt;
&lt;/blockquote&gt;

&lt;p&gt;...One more tool in your toolbox. Now, use it wisely.&lt;/p&gt;&lt;p&gt;&lt;font color="#006600"&gt;Update:&lt;/font&gt; Mark Sowul suggests a simpler solution:&lt;br&gt;
&lt;/p&gt;
&lt;blockquote&gt;return correctValue.Where((testChar, index) =&amp;gt; index
&amp;lt; proposedValue.Length &amp;amp;&amp;amp; testChar ==
proposedValue[index]).Count();&lt;/blockquote&gt;
Somehow I missed that Where overload.&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4358" width="1" height="1"&gt;</description></item><item><title>See you at TechEd EMEA in Barcelona next week</title><link>http://linqinaction.net/blogs/main/archive/2008/11/04/see-you-at-teched-emea-in-barcelona-next-week.aspx</link><pubDate>Mon, 03 Nov 2008 21:42:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4319</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I'll be at &lt;a href="http://www.microsoft.com/emea/teched2008/developer/"&gt;TechEd in Barcelona&lt;/a&gt; next week. I'll be at the Ask The Experts booths a few hours during the week. Feel free to come and say hello. I'll be available if you want to discuss about LINQ, the LINQ in Action book, WPF and Silverlight, my projects, or .NET in general :-)&lt;/p&gt;&lt;p&gt;Please &lt;a href="http://weblogs.asp.net/fmarguerie/contact.aspx"&gt;ping me&lt;/a&gt; if you'll be there too and would like to meet.&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4319" width="1" height="1"&gt;</description></item><item><title>Speaking at DevTeach Montreal in December</title><link>http://linqinaction.net/blogs/main/archive/2008/09/25/speaking-at-devteach-montreal-in-december.aspx</link><pubDate>Thu, 25 Sep 2008 16:11:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4087</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;&lt;a href="http://www.devteach.com"&gt;DevTeach&lt;/a&gt; Montréal will take place this year between December 1 and 5. I have the pleasure to take part to this event and speak in no less than five sessions!&lt;/p&gt;
&lt;p&gt;Here are my sessions, all in French:&lt;br&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tout d'abord une série de quatre sessions que j'ai le plaisir de présenter avec Frédéric Schäfer. Il s'agit d'une reprise enrichie de &lt;a href="http://weblogs.asp.net/fmarguerie/archive/2008/04/10/universit-233-du-si-octo-technology.aspx"&gt;notre session de l'Université du SI&lt;/a&gt;.&lt;br&gt;Ces sessions vous permettrons de découvrir LINQ, Entity Framework, WPF, Silverlight et WCF en action.&lt;br&gt; Il n'est pas nécessaire d'assister à l'ensemble des quatre sessions. Vous pouvez très bien n'assister qu'à certaines sessions. Nous fournirons un bref récapitulatif des épisodes précédents au début de chaque session.&lt;br&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Application Order Tracking - 1/4 - &lt;b&gt;Créer un modèle métier testé avec Entity Framework et manipuler des données avec LINQ&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Application Order Tracking - 2/4 - &lt;b&gt;Développer une interface utilisateur riche et testable avec WPF en utilisant des design patterns&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Application Order Tracking - 3/4 - &lt;b&gt;Persister ses objets avec Entity Framework et adapter l'interface utilisateur en conséquence&lt;/b&gt;&lt;br&gt;&lt;/li&gt;
&lt;li&gt;Application Order Tracking - 4/4 - &lt;b&gt;Développer une application Silverlight distribuée avec WCF&lt;/b&gt;&lt;br&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Je présente également une session en solo : &lt;b&gt;Nouveautés des langages C# 3.0 et VB 9.0 (LINQ)&lt;/b&gt;&lt;br&gt;Il s'agit d'une reprise de la session d'&lt;a href="http://weblogs.asp.net/fmarguerie/archive/2008/01/14/techdays-france-2008-et-mes-sessions-sur-linq.aspx"&gt;Introduction à LINQ, C# 3.0 et VB 9.0&lt;/a&gt; que j'ai jouée avec Philippe Mougin durant les Microsoft TechDays France.&lt;br&gt;&lt;/li&gt;
&lt;/ul&gt;
Frédéric présente une session en solo : &lt;b&gt;Développement piloté par les tests&lt;/b&gt;.&lt;br&gt;&lt;br&gt;Toutes les sessions sont &lt;a href="http://www.devteach.com/Session.aspx"&gt;détaillées sur le site de DevTeach&lt;/a&gt;.&lt;br&gt;
&lt;p&gt;Rendez-vous donc début décembre pour retrouver avec nous la fraîcheur de Montréal à cette époque et la chaleur de nos amis québécois !&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4087" width="1" height="1"&gt;</description></item><item><title>Visual Studio Talk Show podcast about LINQ</title><link>http://linqinaction.net/blogs/main/archive/2008/09/15/visual-studio-talk-show-podcast-about-linq.aspx</link><pubDate>Mon, 15 Sep 2008 09:22:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:4012</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In July, I was invited by &lt;a href="http://www.mariocardinal.com"&gt;Mario Cardinal&lt;/a&gt; and &lt;a href="http://guy.dotnet-expertise.com"&gt;Guy Barrette&lt;/a&gt; to register a session for their &lt;a href="http://www.visualstudiotalkshow.com"&gt;Visual Studio Talk Show&lt;/a&gt; podcast. This session is now &lt;a href="http://www.visualstudiotalkshow.com/Archives/081-5septembre2008-Fabric.html"&gt;online&lt;/a&gt;. During one hour, Guy, Mario and I &lt;b&gt;discuss about LINQ in French&lt;/b&gt;.&lt;/p&gt;&lt;p&gt;You can find the podcast &lt;a href="http://www.visualstudiotalkshow.com/Archives/081-5septembre2008-Fabric.html"&gt;here&lt;/a&gt;. I hope that you'll enjoy it and that it'll help you to learn more about LINQ's whats, whys and hows.&lt;br&gt;&lt;/p&gt;&lt;p&gt;I'd like to thank Mario and Guy for giving me this opportunity. It was a very good experience!&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=4012" width="1" height="1"&gt;</description></item><item><title>LINQ im Einsatz, LINQ in Action in German</title><link>http://linqinaction.net/blogs/main/archive/2008/08/28/linq-im-einsatz-linq-in-action-in-german.aspx</link><pubDate>Wed, 27 Aug 2008 20:59:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:3939</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>6</slash:comments><description>&lt;img src="http://linqinaction.net/photos/main/images/3938/original.aspx" style="margin-right:10px;" width="120" align="left" height="152"&gt;
&lt;p&gt;Today, I received a copy of &lt;b&gt;LINQ im Einsatz&lt;/b&gt;. This is the German translation of &lt;a href="http://www.amazon.com/gp/product/1933988169?ie=UTF8&amp;amp;tag=sharptoolbox-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1933988169"&gt;LINQ in Action&lt;/a&gt;. It's now available from &lt;a href="http://www.amazon.de/LINQ-im-Einsatz-Fabrice-Marguerie/dp/3446414290/"&gt;Amazon.de&lt;/a&gt; and from &lt;a href="http://www.hanser.de/buch.asp?isbn=978-3-446-41429-7"&gt;Hanser&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Bonus: The German version is bigger than the English one. It contains chapter 14, which covers LINQ to DataSet and is provided in English only as a PDF download from &lt;a href="http://www.manning.com/affiliate/idevaffiliate.php?id=252_74"&gt;Manning's website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Maybe we'll see translations in other languages next. French would be a good idea, for example ;-)&lt;/p&gt;
&lt;p&gt;Viel Spaß beim Lesen!&lt;br&gt;&lt;/p&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=3939" width="1" height="1"&gt;</description></item><item><title>Enabling the Expression Tree Visualizer in Visual Studio 2008</title><link>http://linqinaction.net/blogs/jwooley/archive/2008/08/24/enabling-the-expression-tree-visualizer-in-visual-studio-2008.aspx</link><pubDate>Sun, 24 Aug 2008 23:43:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:3916</guid><dc:creator>jwooley</dc:creator><slash:comments>0</slash:comments><description>&lt;DIV class=story&gt;
&lt;P&gt;In LINQ in Action, we discuss how to add the LINQ to SQL Query visualizer into the Visual Studio 2008 environment. This tool allows you to open a window during debug time to view the TSQL that is generated from the LINQ expression tree. It also allows you to run the query and view the results. If you're not familiar with it, check out this post by Scott Guthrie.&lt;/P&gt;
&lt;P&gt;In addition to the query visualizer, you can also build and install the Expression Tree visualizer, not only as a separate application, but also as an integrated visualizer within Visual Studio 2008. To do this, download the Linq Samples from MSDN Code gallery. Inside of that, you can find a project for the ExpressionTreeVisualizer.&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;To use it as a stand alone utility, build and run the ExpressionTreeVisualizersApplication. This is the method most people are familiar with. &lt;/P&gt;
&lt;P&gt;Building the solution will also build the ExpressionTreeVisualizer library. This is the one you need to use to enable it in Visual Studio natively, copy the generated ExpressionTreeVisualizer.dll library and paste it into your ..\Program Files\Microsoft Visual Studio 9.0\Common7\Packages\Debugger\Visualizers directory. &lt;/P&gt;
&lt;P&gt;Once you have placed the library in the visualizers directory, let's see what you can do to use the new visualizer . First, let's build a LINQ to SQL query:&lt;/P&gt;&lt;PRE style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR:blue;"&gt;Dim&lt;/SPAN&gt; query = &lt;SPAN style="COLOR:blue;"&gt;From&lt;/SPAN&gt; cust &lt;SPAN style="COLOR:blue;"&gt;In&lt;/SPAN&gt; dc.Customers _&lt;/PRE&gt;&lt;PRE style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR:blue;"&gt;Where&lt;/SPAN&gt; cust.City = &lt;SPAN style="COLOR:#a31515;"&gt;"London"&lt;/SPAN&gt; _&lt;/PRE&gt;&lt;PRE style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR:blue;"&gt;Order&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;By&lt;/SPAN&gt; cust.CompanyName _&lt;/PRE&gt;&lt;PRE style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR:blue;"&gt;Select&lt;/SPAN&gt; cust&lt;/PRE&gt;&lt;PRE style="MARGIN:0px;"&gt;&amp;nbsp;&lt;/PRE&gt;Given this query, we need to access the expression object exposed by the IQueryable query object as follows:&lt;PRE style="MARGIN:0px;"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR:blue;"&gt;Dim&lt;/SPAN&gt; queryExpression = query.Expression&lt;/PRE&gt;&lt;PRE style="MARGIN:0px;"&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;Now, that we have our code set-up, set a breakpoint in your code after you have instantiated this queryExpression variable and debug your project. Now, if you hover over the query.Expression method, you'll see a new magnifying glass as shown below:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.thinqlinq.com/Images/ExpressionTreeVisualizer1.png"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Clicking on the visualizer icon, will launch the visualizer tool revealing the following screen:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.thinqlinq.com/Images/ExpressionTreeVisualizer2.png"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sure, there's lots of information in there. The expression trees are quite complex. This tool helps you decipher them in cases where you need to either parse or dynamically create expression trees in your applications.&lt;/P&gt;
&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=3916" width="1" height="1"&gt;</description><category domain="http://linqinaction.net/blogs/jwooley/archive/tags/LINQ+Expression+Tree+Visualizer/default.aspx">LINQ Expression Tree Visualizer</category></item><item><title>Object Identity tracking changes with LINQ to SQL SP1</title><link>http://linqinaction.net/blogs/jwooley/archive/2008/08/21/object-identity-tracking-changes-with-linq-to-sql-sp1.aspx</link><pubDate>Thu, 21 Aug 2008 11:24:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:3892</guid><dc:creator>jwooley</dc:creator><slash:comments>0</slash:comments><description>&lt;P&gt;When we wrote LINQ in Action, we took a bit of time to explain how the identity tracking system worked with LINQ to SQL to make sure that changed objects were retained when subsequent queries are requested from a data context. In a nutshell, when you issue a query, the data context translates the LINQ query into TSQL and sends that to the database. The database returns the rowsets to LINQ to SQL. The provider checks the returned rows against those that it is already tracking from previous fetches and, rather than instantiating the object again, returns the object in its internal store. This is done primarily to ensure that changes a user has made in the course of his context's lifetime are retained rather than being overwritten.&lt;/P&gt;
&lt;P&gt;We also discussed (p. 258 if you're following along) how there is a special optimization wherein if you are querying for a single result, the pipeline would check the internal cache first before looking at the database, thus reducing the overhead of repeated hits to the database. An astute reader checked out our claim, and sure enough that optimization did not make it into the RTM bits of VS 2008. We considered &lt;A href="http://linqinaction.net/blogs/main/pages/linq-in-action-errata-first-edition.aspx"&gt;fixing this in the second printing&lt;/A&gt;, but consulted with the product teams first. It turns out that the intended behavior was indeed to include this optimization, but due to a last minute bug, it didn't make it in.&lt;/P&gt;
&lt;P&gt;As &lt;A href="http://blogs.msdn.com/dinesh.kulkarni/archive/2008/08/10/net-fx-3-5-sp1-two-perf-improvements-linq-to-objects-and-linq-to-sql.aspx"&gt;Dinesh points out&lt;/A&gt;, this oversight has been fixed in SP1. Now, if you try to fetch a single object (using Single, SingleOrDefault, First, or FirstOrDefault), the in memory object cache will be checked based on the identity columns declared in the entity's structure. If a matching object is found, it will be returned, otherwise the record will be requested from the database.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 10pt;"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=3892" width="1" height="1"&gt;</description><category domain="http://linqinaction.net/blogs/jwooley/archive/tags/LINQ/default.aspx">LINQ</category></item><item><title>.NET 3.5 SP1 LINQ improvements</title><link>http://linqinaction.net/blogs/main/archive/2008/08/12/net-3-5-sp1-linq-improvements.aspx</link><pubDate>Tue, 12 Aug 2008 09:24:00 GMT</pubDate><guid isPermaLink="false">474e9fbe-b00d-4298-b93d-72ccda50e72d:3808</guid><dc:creator>Fabrice Marguerie</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In May, &lt;a href="http://linqinaction.net/blogs/main/archive/2008/05/15/vs2008-dotnet-3.5-sp1-beta-changes-for-linq-to-sql-and-more.aspx"&gt;I announced&lt;/a&gt; the changes related to LINQ that were included in .NET 3.5 Service Pack 1 Beta. Now that the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=AB99342F-5D1A-413D-8319-81DA479AB0D7&amp;amp;displaylang=en"&gt;SP1 is officially available&lt;/a&gt;, more changes have been announced.&lt;/p&gt;&lt;p&gt;&lt;a href="http://linqinaction.net/blogs/main/archive/2008/05/15/vs2008-dotnet-3.5-sp1-beta-changes-for-linq-to-sql-and-more.aspx"&gt;The originally announced changes&lt;/a&gt; were:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;The support for SQL Server 2008&lt;/li&gt;&lt;li&gt;The release of a new flavor of LINQ: LINQ to Entities, which comes with the ADO.NET Entity Framework&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;a href="http://blogs.msdn.com/dinesh.kulkarni/archive/2008/08/10/net-fx-3-5-sp1-two-perf-improvements-linq-to-objects-and-linq-to-sql.aspx"&gt;Dinesh Kulkarni announces new changes&lt;/a&gt;:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Performance improvements for LINQ to Objects queries&lt;/li&gt;&lt;li&gt;&lt;i&gt;Cast&amp;lt;T&amp;gt;&lt;/i&gt; breaking change&lt;/li&gt;&lt;li&gt;Performance improvements for LINQ to SQL&lt;br&gt;&lt;/li&gt;&lt;/ol&gt;&lt;img src="http://linqinaction.net/aggbug.aspx?PostID=3808" width="1" height="1"&gt;</description></item></channel></rss>
