Recently CodeGuru published the last part of my introductory series of articles on LINQ. Here are the links to the articles: Introduction to LINQ, part 1: LINQ to objects Introduction to LINQ, part 2: LINQ to XML Introduction to LINQ, part 3: LINQ to SQL I hope you’ll enjoy and benefit from the reading.
Category: LINQ
Performance of LINQ Queries
When I delivered the LINQ presentation at the RONUA meeting in April, I was asked how does LINQ perform on big data sets. To answer that I decided to test LINQ to XML against a 100+MB file. I decided to extract three different sets of data from this XML file: 1 set representing about 0.5MB…
LINQ to SQL
LINQ to SQL is an API that allows querying relational databases. The samples in this post are based on the concepts of: Entity classes (which are instances of Entity Types). Such a class is a regular .NET class that is decorated with the attribute Table and its properties and fields with the attribute Column DataContext,…
LINQ Presentation and Demos Available for Download
On Saturday, April 22, I delivered a presentation on LINQ at a meeting of the RONUA community in Timisoara. The presentation was focused on sample codes for LINQ to Objects, LINQ to XML and LINQ to SQL. Today I uploaded on the site the presentation and demo programs so that you can download them. Here…
LINQ to XML
LINQ offers an API called LINQ to XML, formally known as XLinq, that provides support for working with XML. This API resides in the System.Xml.Linq namespace, and you need to add a reference to the assembly with the same name to be able to use it. If you installed the Orcas March CTP bits, the…
yield keyword and lazy evaluation in C#
yield is a new contextual keyword introduced to C# 2.0, vital for lazy evaluation and the performance of queries in LINQ. Being a contextual keyword means that yield can be used as a variable name in C# without any problem. When put before return it becomes a keyword. yield allows one enumerable class to be…
LINQ: declarative and functional syntax
In my last post about LINQ I shown you an example about how to use the language integrated query to select information about directories. In this post I’ll get more into the syntax and show you something about the functional querying style. My examples will focus on displaying information about UEFA Champions Leage winners. Thus,…
LINQ example: listing directories
LINQ is a valuable feature for database and XML programming, but not only. Basically, you can use LINQ with everything that returns an IEnumerable. Here is an example, when I want to list the directories of a parent directory, in alfabetical order, and grouped by the file attributes (first all that have only the flag…
LINQ presentation
Anders Hejlsberg, creator of Turbo Pascal and C#, delivered a great presentation on LINQ on Tuesday. This was actually my first contact with LINQ (which stands for Language INtegrated Query), but it makes me envy the C# and VB.NET programmers, because these are the only two languages that support it. LINQ defines a set of general-purpose…