Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 341 Bytes

MA0078.md

File metadata and controls

15 lines (11 loc) · 341 Bytes

MA0078 - Use 'Cast' instead of 'Select' to cast

Non-compliant code

System.Linq.Enumerable<string> strings = GetStrings();
var stringsAsObjects = strings.Select(str => (object)str);

Compliant code

System.Linq.Enumerable<string> strings = GetStrings();
var stringsAsObjects = strings.Cast<object>(str);