If you were calling a method that didn't exist in IEnumerable, why would resharper suggest changing the type to IEnumerable?
If you were calling a method that didn't exist in IEnumerable, why would resharper suggest changing the type to IEnumerable?
The difference is when you use IEnumerable<T> user method (provided as extension, using IEnum) has to call IEnumerator GetEnumerator() and allocate it on a heap. But that collection have its own implementation which works faster than generic one.
(For others) Most of .NET frameworks generic collections implement the enumerator as a struct which doesnt get allocated on the heap and subsequently garbage collected, but the explicit interfaces implementations use a class which does.
The actual suggestions are based on Microsoft Guidelines :-
https://msdn.microsoft.com/en-us/library/dn169389%28v=vs.110...
I don't use resharper so don't know if it watches out for this, but no doubt there are plenty of other examples.