How to stop Resharper toggling between Enumerable.ToList and Select suggestion

If I use the Resharper code cleanup function, I'm finding my code ...

    var personInfos = persons.Select(Mapper.Map<PersonInfo>).ToList();

is changed to ...

    var personInfos = Enumerable.ToList(persons.Select(Mapper.Map<PersonInfo>));

But then Resharper makes a suggestion "To extension method invocation" for the `Enumerable.ToList` so the code goes back to ...

    var personInfos = persons.Select(Mapper.Map<PersonInfo>).ToList();

I've checked in the Resharper code editing options, but I can't see where/how I can stop this toggling behaviour

4 comments
Comment actions Permalink

Hello Steve,

  What ReSharper build do you have installed - ReSharper | Help | About JB ReSharper?

Thanks!

0
Comment actions Permalink

I've got version 9.2 installed  ... I did upgrade to 10, but had issues with unit test window, so reverted back to 9.2 until issues resolved

Cheers,
SteveC.

0
Comment actions Permalink

Same here with ReSharper Ultimate 2016.1.2. Any solution to this?

0
Comment actions Permalink

This is still an issue with 2012.2.2, I can stop it by following this: http://stackoverflow.com/a/38754363

But this is obviously a bug, when will this be resolved?

0

Please sign in to leave a comment.