¡@

Home 

c# Programming Glossary: this.items.firstordefault

foreach + break vs linq FirstOrDefault performance difference

http://stackoverflow.com/questions/8214055/foreach-break-vs-linq-firstordefault-performance-difference

.ToList public TItem GetItem DateTime day return this.items.FirstOrDefault i i.IsWithinRange day Then I do speed tests which show that.. revealed this is not the best way of doing it return this.items.FirstOrDefault item item.IsWithinRange day by defining a local predicate variable.. TItem bool predicate item item.IsWithinRange day return this.items.FirstOrDefault predicate local predicate builder Func DateTime Func TItem bool..