Are there any appreciable performance differences between:
something.Where(predicate).FirstOrDefault();
and
something.FirstOrDefault(predicate);
?
I tend to use both, but am wondering if there's a clear winner when it comes to performance.
It depends on whether this Where is against an IQueryable or IEnumerable.
In case of IQueryable the difference is based on implementation of the provider but it is more likely there will be no difference and would yield same query.
In case of IEnumerable it should be negligible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With