top | item 7735453

(no title)

bananas | 11 years ago

LINQ isn't a magic bullet.

   collection.Where(s=>s.Transaction.Amount < 100).OrderBy(s=>s.Name).Single();
I'll let you debug the intermittent NullReferenceException that threw in production with no PDBs...

discuss

order

Bognar|11 years ago

You would get a null reference exception if you unrolled that into a loop, too. You should know what your data is going to look like and if any elements could be null or not. Don't blame LINQ for your lack of null checking.

bananas|11 years ago

Yep but you'd know which dereference it was if you unrolled it. Nulls happen unfortunately even with the best checking and intents.

MartinCron|11 years ago

But look at how concise and readable that is!