Posts Tagged linq

LINQ Extensions: Part 1

Tags: , ,

One of C#’s most unique features is its SQL-style LINQ syntax. It’s a powerful and expressive way to treat data structures like a database and perform all kinds of actions on them. LINQ can also be used without the SQL-style syntax via various extension methods of IEnumerable<T> defined in the System.Linq namespace. Due to C#’s extension method feature, we’re free to add on our own LINQ-style functions to extend its power. Today’s article introduces some extension methods to do just that. Read on for the source code and power up your LINQ!

Read the rest of this article »

No Comments

The Magic of LINQ Expressions

Tags: , , ,

LINQ expressions aren’t the same thing as LINQ queries. They’re more like reflection for the syntax of C# itself. It’s a fascinating—and powerful—area of the language and I’ll be exploring it a little in today’s article.

Read the rest of this article »


Basic LINQ Performance

Tags: , , , ,

SQL-style LINQ queries are a concise, readable way of performing various tasks dealing with all kinds of collections. Surely all that convenience comes with a performance cost to it. How bad do you think it is? Today we’ll look at the cost of some basic LINQ queries (Where, Select) versus the equivalent non-LINQ code. We’ll also see how much slower both of them are compared to manually-written, traditional code that does away with all the flexibility. Read on to see the results!

Read the rest of this article »


From AS3 to C#, Part 19: SQL-Style Queries With LINQ

Tags: ,

The series continues today by looking at C#’s SQL-style queries called LINQ. These don’t run on a database, but rather query in-memory objects like arrays. Read on to learn about this powerful tool for writing extremely concise, readable code.

Read the rest of this article »