← All posts

Unsweetening the LINQ Syntactic Sugar

Of all the features built into the .Net framework, LINQ is probably my single favorite. However, sometimes the "syntactic sugar" that LINQ produces can be quite bitter when you get a runtime error and you start trying to decipher some cryptic stack trace where the line causing a problem looks something like "MyNamespace.MyClass._Closure$__111._Lambda$__97". Recently a colleage of mine shared a neat idea/tip on how to make sense out of these errors.

Credit for this idea goes to Jeff Walker, a fellow consultant of mine at Quick Solutions. I would like to thank Jeff for this idea and also thank him for not having a blog so that I can steal and publish his ideas(with permission).

If you have a lot of LINQ code, figuring out which statement is actually causing the problem can be a guess and check experiment when you get an error like this. Jeff's idea which I thought was brilliant, open the compiled code in reflector. Once you do this you can easily find the symbol referenced in the stack trace and decompile the code to find out which statement is actually causing the issue.

Decompiled code viewing LINQ symbols in Reflector
Share Twitter / X LinkedIn

More writing

AI Model Regulation (Fable, GPT-5.6, OSS)

We used to celebrate new AI models, but lately releases are being delayed, restricted, or slow-rolled over national security concerns. Should AI be regulated, and if so, by whom?

AI AI Regulation Anthropic OpenAI OSS

Clustered Indexes and Performance

One of the most overlooked aspects of database design that I see from most application developers is the clustered index. Let us take a moment to discuss why this detail is so important, and to walk through some examples.

Database Performance SQL Server

I'm BACK!

After a brief 8-year break, I decided to start blogging again! Here is what motivated me to start.

Getting Started with the Telerik MVC Extensions

A review of my experience using the Telerik MVC Extensions on several real world projects and instructions for integrating the Telerik MVC Extensions into your ASP.Net MVC project.

Codemash 2012 Recap & Pictures

Codemash Recap and Event Photos from Codemash 2012 including misc event photos, pictures of humorous Tweets on the large screen, a few presentations and the Pecha Kucha talks