LINQ extension methods not available for EnumerableRowCollection

前端 未结 2 1393
傲寒
傲寒 2021-01-18 08:41

I have a following line of code:

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

and I want to

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-18 09:18

    Are you missing

    using System.Linq;
    

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

提交回复
热议问题