Fetching contributors…
Cannot retrieve contributors at this time
31 lines (21 sloc) 820 Bytes

[deprecated] RCS1119: Call 'Find' instead of 'FirstOrDefault'

Property Value
Id RCS1119
Category Performance
Default Severity Info
Enabled by Default
Supports Fade-Out -
Supports Fade-Out Analyzer -


Code with Diagnostic

string s = list.FirstOrDefault(f => f.StartsWith("a")); // RCS1119

Code with Fix

string s = list.Find(f => f.StartsWith("a"));

See Also

(Generated with DotMarkdown)