3 ms·
Well, if your example were meant seriously, it is needlessly verbose. ToList is not necessary in this context, and the type arguments to ToList and FirstOrDefau
by olavk 15y ago
Well, if your example were meant seriously, it is needlessly verbose. ToList is not necessary in this context, and the type arguments to ToList and FirstOrDefault are not necessary since they can be inferred. And anyway, you can just insert line breaks if you think the chain is too long. So:
grain.OfType<Salt>()
.Where(m => m.Value.Contains(nothing))
.OrderBy(m => m.irrelevance)
.FirstOrDefault();
I don't really get your verbosity criticism, sine any alternative I can think of (eg. using for loops) is much more verbose.