Use cast instead of select (ARCH606)
Key dotnet.performance.use-cast-instead-of-select · Severity info · Category performance
A Select lambda that only casts adds an unnecessary delegate invocation; Cast<T>() does it directly.
Incorrect
Section titled “Incorrect”var strings = objects .Select(o => (string)o) .ToList();Correct
Section titled “Correct”var strings = objects .Cast<string>() .ToList();Use Cast<T>() for type conversion.