void Test(IEnumerable<string> items)
{
var asObjects = items.Select(x => (object)x);
}
Use Cast instead of Select to cast.
Cast is more efficient than Select for casting operations, its usage leads to better performance.
This rule shouldn’t be ignored.
void Test(IEnumerable<string> items)
{
var asObjects = items.Select(x => (object)x);
}
void Test(IEnumerable<string> items)
{
var asObjects = items.Cast<object>();
}