Using LINQ in C# .Net 3.5, I have often had cases where I wanted to build my predicates dynamically based on the value of different runtime conditions or by iterating through a list, etc. You can easily append where clauses to an IQueryable<T> like so: query = query.Where(u => u.Name == “Scott”);query = query.Where(u => [...]

In a project I’m working on, and using LINQ, there have come a few times when I have needed to create my own SQL and send a query to the database. This has typically happened when I’m not doing queries that aren’t very straight forward, but I still want to accomplish the task with only [...]

LINQ "gotchas"

21Jan08

I am using VS 2008 and LINQ (specifically LINQ to SQL) for a project at work right now. As I jump into this, I am going to document some of the pros, cons, and “gotchas” that I come across. Any articles in this series will have the label “LINQ” . Here is my first list [...]