Chris Stuff
Categories
-
Recent Posts
Recent Comments
Archives
- February 2013
- January 2013
- December 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- December 2011
- May 2011
- March 2011
- December 2010
- August 2010
- May 2010
- March 2010
- February 2010
- January 2010
- December 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- January 2009
Category Archives: LINQ
Simplifying LazyLinq
This is the fourth in a series of posts on LazyLinq, a wrapper to support lazy initialization and deferred disposal of a LINQ query context: Introducing LazyLinq: Overview Introducing LazyLinq: Internals Introducing LazyLinq: Queryability Simplifying LazyLinq Introducing LazyLinq: Lazy DataContext … Continue reading
Also posted in Testing
3 Comments
Introducing LazyLinq: Queryability
This is the third in a series of posts on LazyLinq, a wrapper to support lazy initialization and deferred disposal of a LINQ query context: Introducing LazyLinq: Overview Introducing LazyLinq: Internals Introducing LazyLinq: Queryability Simplifying LazyLinq Introducing LazyLinq: Lazy DataContext … Continue reading
Also posted in Best Practices, Design Principles, SOLID, Testing
5 Comments
Introducing LazyLinq: Overview
This is the first in a series of posts on LazyLinq, a wrapper to support lazy initialization and deferred disposal of a LINQ query context, including LINQ to SQL’s DataContext: Introducing LazyLinq: Overview Introducing LazyLinq: Internals Introducing LazyLinq: Queryability Simplifying … Continue reading
Also posted in DRY, jQuery
5 Comments
Using IDisposables with LINQ
Objects that implement IDisposable are everywhere. The interface even gets its own language features (C#, VB, F#). However, LINQ throws a few wrenches into things: LINQ’s query syntax depends on expressions; using blocks are statements. When querying a sequence of … Continue reading
Also posted in Best Practices, Testing
10 Comments
Improve Your Code Golf Game with LINQ
I always enjoy a good coding challenge, and variations of code golf are most common. For the uninitiated, code golf provides a problem with the objective of providing a solution that requires the fewest keystrokes or lines. While production code … Continue reading
Also posted in IoC, StructureMap
Leave a comment
Project-wide controller survey through reflection
I often lose track of all of the different controllers in our system, especially if I’m trying to see what existing conventions we have in place for the design of actions. To get around this, I use a simple LINQ … Continue reading
Visualizing LINQ expressions in the debugger
In Ben’s recent post on Fluent Route Testing in ASP.NET MVC, he recalled a problem we had when trying to figure out how to deal with an Expression<> once we have one. Typically, I like to parse the Expression to … Continue reading
Deferred execution gotchas
I was trying to be clever the other day and try to chain assertions on an array: [Test] public void This_does_not_work() { var items = new[] {1, 2, 3, 4, 5}; items .Each(x => x.ShouldBeLessThan(0)) .Each(x => x.ShouldBeGreaterThan(10)); } I … Continue reading
Query Objects with Repository Pattern Part 2
As promised in my previous post, I’m going to make our query object a little more flexible and dynamic. First, this is what I really want to be able to do something like this: var customers = repo.FindBy( new TopCustomersWithLowDiscountQuery() … Continue reading
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

