The method 'Where' cannot follow the method 'Select' or is not supported

后端 未结 3 1440
甜味超标
甜味超标 2020-12-11 22:37

Why am I getting:

The method \'Where\' cannot follow the method \'Select\' or is not supported. Try writing the query in terms of supported methods

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 23:00

    Why don't you just move the where so it is before the projection? It will result in a single query being executed which filters and projects:

    XrmServiceContext.CreateQuery().Where(p => p.FirstName == "John").Project().To().First();
    

提交回复
热议问题