Category Archives: LINQ

Query Objects with the Repository Pattern

Nate Kohari (whose primate brain is far too small to comprehend this post [inside joke, he’s actually really sharp]) was asking on Twitter today about how to structure his repositories: Per aggregate root, Per entity, or just one repository for … Continue reading 

| Leave a comment

Expressions and Lambdas

Some conversation on a recent post on Chad’s blog brought up the confusion between Lambdas and Expressions.  A while back, I went into the various ways to create delegates throughout the different versions of C#.  Although I touched on it … Continue reading 

| Leave a comment

Some improved LINQ operators

I ran across a couple of scenarios the other day that were made pretty difficult given the current LINQ query operators.  First, I needed to see if an item existed in a collection.  That’s easy with the Contains method, when … Continue reading 

| Leave a comment

LINQ query operators: lose that foreach already!

Now that .NET 3.5 is out with all its LINQ query operator goodness, I feel like going on a mean streak of trashing a lot of our (now) pointless foreach loops.  Some example operations include: Transformations Aggregations Concatenations Filtering As … Continue reading 

| 13 Comments

Enhancing mappers with LINQ

The “big 3″ higher-order functions in functional programming are Filter, Map and Reduce.  When looking at the new C# 3.0 LINQ query operators, we find that all three have equivalents: Filter = Where Map = Select Reduce = Aggregate Whenever … Continue reading 

| Leave a comment