LINQ extension methods not available for EnumerableRowCollection & lt; TRow & gt;

advertisements

I have a following line of code:

var availableClients = (Controller.ListClientsForCurrentUser() as DataTable).AsEnumerable();

and I want to take advantage of LINQ's extension methods (MSDN) like Any. But those methods are not visible. What is going on? I can only see Where, Select and order by methods.


Are you missing

using System.Linq;

by any chance? Once you've got an EnumerableRowCollection<TRow> it should be fine. (The main problem using a DataTable if if you forget to call AsEnumerable, but that isn't a problem here.)