Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context.
代码如下:
var query = from s in db.LoginUserServices
join ss in db.Services on s.ServiceType equals ss.Code into s_ss_join
from s_ss in s_ss_join.DefaultIfEmpty()
where s.LoginUserID.Equals(LoginUserID)
select new
{
// ServiceType = s.ServiceType,
ServiceName = s_ss.Name,
ServiceProperty = s_ss.Property,
ServiceCode = s.ServiceType
};
Linq to Array中报错:
报错位置:
Equals
改为:
var query = from s in db.LoginUserServices
join ss in db.Services on s.ServiceType equals ss.Code into s_ss_join
from s_ss in s_ss_join.DefaultIfEmpty()
where s.LoginUserID==LoginUserID
select new
{
// ServiceType = s.ServiceType,
ServiceName = s_ss.Name,
ServiceProperty = s_ss.Property,
ServiceCode = s.ServiceType
};
Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context.的更多相关文章
- Unable to create a constant value of type 'Closure type'
使用Linq to Entities的时候发生如下异常: Unable to create a constant value of type 'Closure type'. Only primitiv ...
- The type 'System.Object' is defined in an assembly that is not referenced
记录一个错误,报 The type 'System.Object' is defined in an assembly that is not referenced,[System.Runtime] ...
- [Hive - Tutorial] Type System 数据类型
数据类型Type System Hive supports primitive and complex data types, as described below. See Hive Data Ty ...
- Unable to create the store directory. (Exception from HRESULT: 0x80131468)
一个ASP.NET的程序,使用了MS ReportViewer报告控件,在用该控件导出生成Excel文件时,先是提示行不能超过65535. 这个是由于Excel2003的行限制的原因.由于修改成用Ex ...
- JVM虚拟机宕机_java.lang.OutOfMemoryError: unable to create new native thread
原因:当前用户的系统最最大程序数数已达到最大值,使用ulimit -u可以看到是1024 解决办法:在当前用户下使用ulimit -u 65535 然后再执行jsp,一切ok 功能说明:控 ...
- Fatal error in launcher Unable to create process using 'dapppythonpython37python
Fatal error in launcher: Unable to create process using '"d:\app\python\python37\python.exe&quo ...
- 记一次tomcat线程创建异常调优:unable to create new native thread
测试在进行一次性能测试的时候发现并发300个请求时出现了下面的异常: HTTP Status 500 - Handler processing failed; nested exception is ...
- 解决Unable to create new native thread
两种类型的Out of Memory java.lang.OutOfMemoryError: Java heap space error 当JVM尝试在堆中分配对象,堆中空间不足时抛出.一般通过设定J ...
- ArcEngine编辑保存错误:Unable to create logfile system tables
通过ArcEngine对多个SDE中多个图层进行批量编辑处理,其中有部分图层在结束编辑的时候出现错误提示(部分图层可以,只有两个数据较多的图层保存失败). 错误信息:Unable to create ...
随机推荐
- CTF<密码学> writeup 传统知识+古典密码
小明某一天收到一封密信,信中写了几个不同的年份 辛卯,癸巳,丙戌,辛未,庚辰,癸酉,己卯,癸巳. 信的背面还写有“+甲子”,请解出这段密文. key值:CTF{XXX} 百度可以查到 ...
- js 中常见的深拷贝的方法
建议最简单的第一种 1.通过 JSON 对象实现深拷贝 this.data = JSON.parse(JSON.stringify(this.vm.$store.state.security.menu ...
- 腾讯地图添加多个Marker
//重置地图 init(){ var self = this; this.wSize = { wHeight: window.innerHeight-, wWidth: window.innerWid ...
- Java正则表达式-匹配正负浮点数
记录缘由: 公司项目需要从xml中获取标识为NUMBER的字符串,将之存入数据库中,存入的列的类型即为NUMBER.当遇到非数字时,原实现是通过异常: String plainValue = null ...
- js验证码有效时间倒计时
js验证码有效时间倒计时 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type& ...
- javascrpit sort()数组对象中排序
/*ionic 调用 * @param attr 排序的属性 如number属性 * @param rev true表示升序排列,false降序排序 * */ commonSortMethod(att ...
- 理解restful 架构 && RESTful API设计指南
restful是前端和后端接口中都会使用的设计思想. 网站即软件,我们也常说的webapp,这种互联网软件采用的是“客户端/服务器”模式,建立在分布式体系上. 网站开发,也可以完全采用软件开发的模式, ...
- IDEA里如何安装Python插件打造开发环境(图文详解)
前言 python是一种功能强大和适用面很广的开发语言,在大数据应用和机器学习日益流行的年代,python凭借其简洁.易用和可扩展性获得很多用户的支持,近年来使用率高速增长.python环境下,集成了 ...
- yum无法正常安装,提示如下 There are no enabled repos Run "yum repolist all"
一般来说著名的linux系统基本上分两大类:1 RedHat系列:Redhat.Centos.Fedora等2 Debian系列:Debian.Ubuntu等RedHat 系列:1 常见的安装包格式 ...
- shell脚本检测监控mysql的CPU占用率
网站访问量大的时候mysql的压力就比较大,当mysql的CPU利用率超过300%的时候就不能提供服务了,近乎卡死状态,这时候最好的方法 就是重启mysql服务.由于这种事具有不可预见性,我们不知道什 ...