This is my function:
private IEnumerable SeachItem(int[] ItemIds)
{
using (var reader = File.OpenText(Application.StartupPath + @\"
One thing to remember is that LINQ statements use deferred execution. What that means is that your LINQ statement doesn't actually execute until you either iterate over it in a foreach statement or you call the .ToList() method on myLine.
For your example try changing:
return myLine;
To:
return myLine.ToList();