-
Recent Posts
Recent Comments
Archives
Categories
- Analytics
- AppHarbor
- ASP.NET MVC
- ASP.NET Web API
- AutoMapper
- Best Practices
- Book Review
- Books
- Comments
- Communication
- Continuous Improvement
- Continuous Integration
- CSS
- Deployment
- Design
- Design Patterns
- Design Principles
- Development
- DRY
- Favorites
- Fluent NHibernate
- For Fun
- git
- IoC
- IowaCodeCamp
- JavaScript
- jQuery
- Legacy Code
- LINQ
- LosTechies
- Members
- Moq
- NUnit
- Open Source
- Personal
- Project Management
- Rant
- Reading Code
- RhinoMocks
- SEO
- SOLID
- Spark
- StructureMap
- Testing
- Uncategorized
Meta
Category Archives: LINQ
Queue is Always Empty Using yield return
I ran into an issue in a C# application the other day. Thankfully I figured out what was going wrong right away, but it could have turned into a big headache potentially.
Also posted in ASP.NET MVC
2 Comments
Autoprojecting LINQ queries
Something I’ve been looking at adding to AutoMapper was the idea of doing automatic query projection in the Select query projection in LINQ statements. One downside of AutoMapper is that projection from domain objects still forces the entire domain object … Continue reading
What is Projection?
I think there’s great benefit in not only knowing how to design your code to use common patterns but also to be able to speak about them clearly and concisely to others. If I mention that the problem sounds like … Continue reading
Also posted in Communication, Reading Code
10 Comments
Implementing Domain Queries
My current Repository interface looks something like this: public interface IRepository { T FindOne<T>(int id); T FindBy<T>(Expression<Func<T, bool>> expression); IEnumerable<T> FindAllBy<T>(Expression<Func<T, bool>> expression); IEnumerable<T> FindAll<T>(); T FindOneBy<T>(Expression<Func<T, bool>> expression); void Save<T>(T target); void Update<T>(T target); void SaveOrUpdate<T>(T target); void Delete<T>(T … Continue reading
Also posted in Communication, Reading Code
10 Comments
Selecting Static Results with Dynamic LINQ
Dynamic LINQ (DLINQ) is a LINQ extension provided in the VS 2008 Samples. Scott Guthrie provides a good overview here: Dynamic LINQ (Part 1: Using the LINQ Dynamic Query Library), but the executive summary is that it implements certain query … Continue reading
Also posted in Best Practices, Design Principles, Legacy Code, Testing
8 Comments
LINQ query operators and null lists
One of my pet peeves with the LINQ extension methods is their inability to handle null source lists. For example, this will throw an ArgumentNullException: [Test] public void Should_handle_nulls() { List<int> ints = null; ints.Any(num => num < 0).ShouldBeFalse(); } … Continue reading
More missing LINQ operators
Continuing an old post on missing LINQ operators, the wonders of extension methods allow us as developers to fill potential holes in LINQ operators. Whether it’s a Zip method (now included in .NET 4.0), or better methods for IComparer-based operators, … Continue reading
Hacking LINQ Expressions: Join With Comparer
In this installment of my Hacking LINQ series we’ll take a look at providing an IEqualityComparer for use in a LINQ join clause. The Problem Many of the Standard Query Operators require comparing sequence elements and the default query providers … Continue reading
Also posted in For Fun, Testing
6 Comments
Hacking LINQ Expressions: Select With Index
First, a point of clarification: I use LINQ Expressions to mean (Language-INtegrated) Query Expressions (the language feature) rather than Expression Trees (the .NET 3.5 library in System.Linq.Expressions). So what do I mean by “Hacking LINQ Expressions”? Quite simply, I’m not … Continue reading
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
