C# Linq Where(expression).FirstorDefault() vs .FirstOrDefault(expression)

Either is fine.

They both run lazily – if the source list has a million items, but the tenth item matches then both will only iterate 10 items from the source.

Performance should be almost identical and any difference would be totally insignificant.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)