Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I avoid timeout in immediate window?

I have a regular, in-memory List<T> containing approximatley 10k items. When I'm trying to query this list in the visual studio immediate window I get an error:

MyList.Where(m => m.Name.StartsWith("x"))
{System.Linq.Enumerable.WhereListIterator<T>}
    Error: Evaluation timed out

I checked the source for System.Linq.WhereListIterator<T> and it does not appear to throw any exceptions, so I'm guessing it is the immediate window that decides when to time out the query. Is there any way to configure when to time out or avoid this in another way?

like image 406
Lorentz Vedeler Avatar asked Jan 12 '17 15:01

Lorentz Vedeler


1 Answers

Just evaluate this expression using ToArray() or ToList() like this MyList.Where(m => m.Name.StartsWith("x")).ToList().

like image 192
Tomas Petovsky Avatar answered Oct 27 '22 00:10

Tomas Petovsky