报错:System.NotSupportedException: LINQ to Entities does not recognize the method
报错 to The not system does method LinQ
2023-09-11 14:16:51 时间
报错:System.NotSupportedException: LINQ to Entities does not recognize the method ...... get_Item(Int32)' method, and this method cannot be translated into a store expression.
在控制器中有如下一段代码:
var tempList = SomeService.LoadEntities(c => c.DelFlag == (short)DelFlagEnum.Normal);var result = from l in tempListselect new { n = l.Name, a = l.Age };
LoadEntities方法返回的类型是IQueryable<T>,如果要对集合用Select方法,在用Select方法之前需要ToList一下。
修改成:
var result = from l in tempList.ToList()select new { n = l.Name, a = l.Age };
相关文章
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
- AFNetworking 报错JSON text did not start with array or object and option to allow fragments not set…
- 报错:Flink Could not resolve substitution to a value: ${akka.stream.materializer}
- 报错:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1
- 解决Maven打包时报错"The packaging for this project did not assign a file to the build artifact"
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
- The connection to the server ip:6443 was refused - did you specify the right host or port
- The reference to entity "characterEncoding" must end with the ';' delimiter
- rabbitmq报错Failed to start RabbitMQ broker
- Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project报错
- The GuidRepresentation for the reader is CSharpLegacy, which requires the binary sub type to be Uuid
- 报错: LINQ to Entities 不识别方法“Int32 Parse(System.String)
- .NET错误The 'targetFramework' attribute in the <compilation> element of the Web.config file is used only to target version 4.0 and later of the .NET Framework
- failed to create pid file /var/run/rsyncd.pid: File exists报错
- npm 报错unable to verify the first certificate
- vmware Unable to open kernel device ".Globalvmx86": The system cannot find the file 的解决方法
- php 遇到报错 Call to a member function fetch_object()
- ubuntu添加源报错The following signatures couldn't be verified because the public key is not available
- 解决报错 We‘re sorry but doesn‘t work properly without JavaScript enabled. Please enable it to continue.
- mysql导出数据报错The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
- PHP错误:SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
- Android实现无任务栏,无标题栏的方法以及可能出现报错的原因
- Unity 常见问题 之 打包编译的报错 Unable to sign the application; please provide passwords!
- Unity 报错之 ToLua打包:Unable to find tolua DllNotFoundException: tolua
- Unity 报错之 The same field name is serialized multiple times in the class or its parent class.
- 《To prune, or not to prune:exploring the efficacy of pruning for model compression》论文笔记
- 圣诞特辑-解决idea新建报错The required Java version 11 is not supported by the project SDK 1.8.