Browse by Tags

All Tags » C# » LINQ (RSS)

Reimplementing LINQ to Objects: Part 10 - Any and All

Another day, another blog post. I should emphasize that this rate of posting is likely to be short-lived... although if I get into the habit of writing a post on the morning commute when I go back to work after the Christmas holidays, I could keep ploughing...
Posted by skeet | 9 comment(s)
Filed under: , ,

Reimplementing LINQ to Objects: Part 9 - SelectMany

The next operator we'll implement is actually the most important in the whole of LINQ. Most (all?) of the other operators returning sequences can be implemented via SelectMany. We'll have a look at that at the end of this post, but let's implement...
Posted by skeet | 4 comment(s)
Filed under: , ,

Reimplementing LINQ to Objects: Part 8 - Concat

After our quick visit to scalar return types with Count and LongCount, we're back to an operator returning a sequence: Concat. What is it? Concat only has a single signature, which makes life simple: public   static IEnumerable<TSource>...
Posted by skeet | 7 comment(s)
Filed under: , ,

Reimplementing LINQ to Objects: Part 7 - Count and LongCount

Today's post covers two operators in one, because they're so incredibly similar... to the point cut and paste of implementation, merely changing the name, return type, and a couple of variables. What are they? Count and LongCount each have two...
Posted by skeet | 18 comment(s)
Filed under: , ,

Reimplementing LINQ to Objects: Part 6 - Repeat

A trivial method next, with even less to talk about than "Empty"... "Repeat". This blog post is merely a matter of completeness. What is it? "Repeat" is a static, generic non-extension method with a single overload: public...
Posted by skeet | 2 comment(s)
Filed under: , ,

Reimplementing LINQ to Objects: Part 5 - Empty

Continuing with the non-extension methods, it's time for possibly the simplest LINQ operator around: "Empty". What is it? "Empty" is a generic, static method with just a single signature and no parameters: public   static...
Posted by skeet | 11 comment(s)
Filed under: , ,

Reimplementing LINQ to Objects: Part 4 - Range

This will be a short post, and there'll probably be some more short ones coming up too. I think it makes sense to only cover multiple operators in a single post where they're really similar. (Count and LongCount spring to mind.) I'm in your...
Posted by skeet | 12 comment(s)
Filed under: , ,

Reimplementing LINQ to Objects: Part 3 - "Select" (and a rename...)

It's been a long time since I wrote part 1 and part 2 of this blog series, but hopefully things will move a bit more quickly now. The main step forward is that the project now has a source repository on Google Code instead of just being a zip file...
Posted by skeet | 9 comment(s)
Filed under: , ,

Query expression syntax: continuations

In this Stack Overflow question , I used a query continuation from a select clause, and one commenter expressed surprise, being unaware of what "select ... into" meant. He asked for any references beyond the MSDN "into" page , and...
Posted by skeet | 13 comment(s)
Filed under: ,

Reimplementing LINQ to Objects: Part 2 - "Where"

Warning: this post is quite long. Although I've chosen a simple operator to implement, we'll encounter a few of the corner cases and principles involved in LINQ along the way. This will also be a somewhat experimental post in terms of format,...
Posted by skeet | 22 comment(s)
Filed under: , ,

Reimplementing LINQ to Objects: Part 1 - Introduction

About a year and a half ago, I gave a talk at a DDD day in Reading, attempting to reimplement as much of LINQ to Objects as possible in an hour. Based on the feedback from the session, I went far too fast... and I was still a long way from finishing....
Posted by skeet | 24 comment(s)
Filed under: , ,

Just how lazy are you?

I've been reviewing chapter 10 of C# in Depth, which is about extension methods. This is where I start introducing some of the methods in System.Linq.Enumerable, such as Where and Reverse. I introduce a few pieces of terminology in callouts - and...
Posted by skeet | 17 comment(s)
Filed under: , ,

Optimisations in LINQ to Objects

(Edited on February 11th, 2010 to take account of a few mistakes and changes in the .NET 4.0 release candidate.) I've just been fiddling with the first appendix of C# in Depth, which covers the standard query operators in LINQ, and describes a few...
Posted by skeet | 26 comment(s)
Filed under: , ,

LINQ to Rx: second impressions

My previous post had the desired effect: it generated discussion on the LINQ to Rx forum , and Erik and Wes very kindly sent me a very detailed response too. There's no better way to cure ignorance than to display it to the world. Rather than regurgitating...
Posted by skeet | 3 comment(s)
Filed under: , ,

First encounters with Reactive Extensions

I've been researching Reactive Extensions for the last few days, with an eye to writing a short section in chapter 12 of the second edition of C# in Depth. (This is the most radically changed chapter from the first edition; it will be covering LINQ...
Posted by skeet | 15 comment(s)
Filed under: , , ,

An object lesson in blogging and accuracy; was: Efficient "vote counting" with LINQ to Objects - and the value of nothing

Well, this is embarrassing. Yesterday evening, I excitedly wrote a blog post about an interesting little idea for making a particular type of LINQ query (basically vote counting) efficient. It was an idea that had occurred to me a few months back, but...
Posted by skeet | 11 comment(s)
Filed under: , ,

What's in a name?

T.S. Eliot had the right idea when he wrote "The naming of cats" : The Naming of Cats is a difficult matter, It isn't just one of your holiday games ... When you notice a cat in profound meditation, The reason, I tell you, is always the...
Posted by skeet | 23 comment(s)
Filed under: , , ,

Designing LINQ operators

I've started a small project (I'll post a link when I've actually got something worthwhile to show) with some extra LINQ operators in - things which I think are missing from LINQ to Objects, basically. (I hope to include many of the ideas...
Posted by skeet | 16 comment(s)

You don't have to use query expressions to use LINQ

LINQ is clearly gaining a fair amount of traction, given the number of posts I see about it on Stack Overflow . However, I've noticed an interesting piece of coding style: a lot of developers are using query expressions for every bit of LINQ they...
Posted by skeet | 18 comment(s)

November 19th: London .NET User Group, Push LINQ!

On November 19th, I'll be speaking at the London .NET User Group about Push LINQ. I was quite pleasantly surprised by being able to explain it to some extent in Copenhagen, and this evening will be entirely about Push LINQ, so I'll be able to...
Posted by skeet | 6 comment(s)
More Posts « Previous page - Next page »