LINQ extension methods not available for EnumerableRowCollection

前端 未结 2 1394
傲寒
傲寒 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<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.)

    0 讨论(0)
  • 2021-01-18 09:26

    Check that there are

    using System.Data;
    using System.Linq;
    

    and that you are referencing System.Core and System.Data

    0 讨论(0)
提交回复
热议问题