Why resharper does not suggest to use linq when interating over a List?

I am using Resharper 2018.1.3 (I updated to 2018.2.0 and I experienced the same issue) with Visual Studio 2017.

When I type this code:

var test = new List<string>();
var strings = new[] { "a", "b", "c" };
foreach (var a in strings)
{
    test.Add(a);
}

Resharper suggests to convert it into LINQ-expression.

But if I use a List:

var test = new List<string>();
var strings = new List<string> { "a", "b", "c" };
foreach (var a in strings)
{
    test.Add(a);
}

Resharper gives me no hint. Why?

0

Please sign in to leave a comment.