It occurred to me that I write out linq statements in a simple, but what others may define as verbose manner;
A simple example:
return _entries
.Where(x => x.Context.Equals(context))
.Where(x => x.Type == typeof (T))
.Select(x=>x.Value)
.Cast<T>()
.Single();
can be simplified to:
return _entries
.Where(x => x.Context.Equals(context) && x.Type == typeof (T))
.Select(x=>(T)x.Value)
.Single();
[Question] In the long run, which is the better coding practice? i.e. long (and simple) linq chains or short linq chains with more complicated selectors/etc?
It is right to assume that these Linq statements will be optimized by the compiler?